:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-gradient-1: #e0e7ff;
  --bg-gradient-2: #f3e8ff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --success: #22c55e;
  --success-hover: #16a34a;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --card-bg: rgba(255, 255, 255, 0.7);
  --border-color: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
  position: relative;
  overflow-x: hidden;
}

.background-decor {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.3) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  top: -100px;
  left: -100px;
  z-index: 0;
}

.background-decor.decor-2 {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.3) 0%, rgba(255,255,255,0) 70%);
  top: auto;
  bottom: -100px;
  right: -100px;
  left: auto;
}

.container {
  width: 100%;
  max-width: 600px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.header {
  text-align: center;
  margin-bottom: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  color: white;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.header p {
  color: var(--text-muted);
  font-size: 1rem;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

input[type="number"],
select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-dark);
  transition: all 0.2s ease;
  outline: none;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.custom-select {
  position: relative;
}

.custom-select select {
  appearance: none;
  cursor: pointer;
}

.select-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

.btn-primary, .btn-success {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.2);
}

.btn-success:hover {
  background: var(--success-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.3);
}

.error-message {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--danger-light);
  color: var(--danger);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

/* Result Section */
.result-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--primary-color);
}

.grid-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
}

.detail-item .icon {
  font-size: 1.25rem;
}

.detail-content {
  display: flex;
  flex-direction: column;
}

.detail-content .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-content .value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
  word-break: break-word;
}

.divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
  margin: 1.5rem 0;
}

.text-block {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
}

.text-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.text-block p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pre-line {
  white-space: pre-line;
}

.alert-block {
  background: rgba(37, 99, 235, 0.05);
  border-left: 4px solid var(--primary-color);
}

.alert-block p {
  color: var(--text-dark);
  font-weight: 500;
}

.action-footer {
  margin-top: 2rem;
}

.loader {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .grid-details {
    grid-template-columns: 1fr;
  }
}
