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

:root {
  --bg: #0f0f12;
  --surface: #1a1a1f;
  --border: #2a2a32;
  --text: #e8e8ed;
  --text-muted: #8b8b96;
  --accent: #7c6ef7;
  --accent-dim: rgba(124, 110, 247, 0.15);
  --success: #4ade80;
  --error: #f87171;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8b96' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

.btn-submit {
  margin-top: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-submit:hover {
  opacity: 0.9;
}

.btn-submit:active {
  transform: scale(0.98);
}

.result {
  animation: fadeIn 0.4s ease;
}

.result.hidden,
.error.hidden {
  display: none;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
}

.result-section {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.result-section:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.result-section.hidden {
  display: none;
}

.profile-summary-section {
  background: var(--accent-dim);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 0.5rem;
}

.profile-summary {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.rashi-badge {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.rashi-sanskrit {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.rashi-english {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.degree-info {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.ruling-planet {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.nakshatra-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.nakshatra-pada,
.nakshatra-ruler {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.interpretation-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.interpretation-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.interpretation-subtitle {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.interpretation-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.explanation {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.error {
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--error);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 8px;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 480px) {
  .app {
    padding: 3rem 2rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .form {
    gap: 1.5rem;
  }

  .result-card {
    padding: 2rem;
  }

  .rashi-sanskrit {
    font-size: 1.75rem;
  }
}
