/* ============================================================
   QSimulado — Auth & Onboarding
   ============================================================ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-white);
}

@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

.auth-aside {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 3rem 3rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 80% 10%, rgba(47, 191, 113, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(255, 255, 255, 0.06), transparent 50%),
    linear-gradient(160deg, #0c2a47 0%, #123b63 55%, #164870 100%);
  color: #ffffff;
}

@media (min-width: 1024px) {
  .auth-aside {
    display: flex;
  }
}

.auth-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 10%, transparent 75%);
  pointer-events: none;
}

.auth-aside > * {
  position: relative;
  z-index: 1;
}

.auth-aside-logo-wrap {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.45rem 0.7rem;
}

.auth-aside-logo {
  height: 2.4rem;
  width: auto;
  max-width: 13rem;
}

.auth-aside-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: clamp(1.85rem, 2.6vw, 2.5rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 0.85rem;
}

.auth-aside-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 24rem;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1.25rem;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(47, 191, 113, 0.06), transparent 50%),
    #f4f7fa;
  min-height: 100vh;
}

.auth-panel {
  width: 100%;
  max-width: 26.5rem;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1.15rem;
  box-shadow: var(--shadow-elevated);
  padding: 1.75rem 1.5rem;
}

@media (min-width: 640px) {
  .auth-card {
    padding: 2.15rem 2rem;
  }
}

.auth-mobile-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 1024px) {
  .auth-mobile-brand {
    display: none;
  }
}

.auth-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--color-blue);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.auth-subtitle {
  margin: 0 0 1.6rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Form controls ---------- */
.field {
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-blue);
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

.field-input-wrap {
  position: relative;
}

.field-input {
  width: 100%;
  border: 1px solid var(--color-border-strong);
  background: #ffffff;
  color: var(--color-text);
  border-radius: 0.75rem;
  padding: 0.8rem 0.95rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.field-input::placeholder {
  color: #98a5b5;
}

.field-input:hover {
  border-color: rgba(18, 59, 99, 0.2);
}

.field-input:focus {
  border-color: rgba(47, 191, 113, 0.65);
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.14);
}

.field-input.is-invalid {
  border-color: #e35d6a;
  box-shadow: 0 0 0 3px rgba(227, 93, 106, 0.12);
}

.field-input.has-toggle {
  padding-right: 2.75rem;
}

textarea.field-input {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.45;
}

.field-toggle {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.field-toggle:hover {
  color: var(--color-blue);
  background: var(--color-light);
}

.field-error {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #d14555;
  font-weight: 500;
}

.field-error.is-visible {
  display: block;
}

.field-hint {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 1.15rem;
}

.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.35rem;
  border: 1.5px solid var(--color-border-strong);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
  transition: all var(--transition);
  color: transparent;
}

.checkbox input:checked + .checkbox-box {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
}

.checkbox input:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.16);
}

.checkbox.is-invalid .checkbox-box {
  border-color: #e35d6a;
}

.link-muted {
  color: var(--color-blue);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.link-muted:hover {
  color: var(--color-green);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.25rem 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--color-border);
}

.auth-foot {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.auth-trust {
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.auth-trust i {
  color: var(--color-green);
}

/* Password strength */
.strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.strength-bar {
  height: 0.28rem;
  border-radius: 999px;
  background: #e6ebf1;
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width var(--transition), background var(--transition);
}

.strength[data-level='1'] .strength-bar:nth-child(1) span {
  width: 100%;
  background: #e35d6a;
}
.strength[data-level='2'] .strength-bar:nth-child(-n + 2) span {
  width: 100%;
  background: #f0a202;
}
.strength[data-level='3'] .strength-bar:nth-child(-n + 3) span {
  width: 100%;
  background: #3da9fc;
}
.strength[data-level='4'] .strength-bar span {
  width: 100%;
  background: var(--color-green);
}

.strength-label {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Button loading */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
  position: relative;
}

.btn.is-loading .btn-label {
  opacity: 0;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after {
  border-color: rgba(18, 59, 99, 0.2);
  border-top-color: var(--color-blue);
}

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

/* ---------- Auth illustration ---------- */
.auth-illus {
  margin-top: 2.5rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.15rem;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.35);
}

.auth-illus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.auth-illus-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #d8ffe9;
  background: rgba(47, 191, 113, 0.18);
  border: 1px solid rgba(47, 191, 113, 0.25);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.auth-illus-bars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-illus-bar label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.28rem;
}

.auth-illus-track {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.auth-illus-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fbf71, #6ee7a4);
}

/* ---------- Onboarding ---------- */
.onboard-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 50% 35% at 80% 0%, rgba(47, 191, 113, 0.08), transparent 55%),
    #f4f7fa;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.onboard-top {
  max-width: 44rem;
  width: 100%;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.onboard-card {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-elevated);
  padding: 1.5rem 1.25rem 1.75rem;
  flex: 1;
}

@media (min-width: 768px) {
  .onboard-card {
    padding: 2.25rem 2.25rem 2rem;
  }
}

.progress-wrap {
  margin-bottom: 1.75rem;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.progress-meta strong {
  color: var(--color-green);
  font-weight: 600;
}

.progress-bar {
  height: 0.4rem;
  border-radius: 999px;
  background: #e8eef4;
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fbf71, #4fd487);
  transition: width 0.45s var(--ease);
}

.stepper {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
}

.stepper-dot {
  height: 0.28rem;
  flex: 1;
  border-radius: 999px;
  background: #e8eef4;
  transition: background var(--transition);
}

.stepper-dot.is-active,
.stepper-dot.is-done {
  background: var(--color-green);
}

.onboard-step {
  display: none;
  animation: fadeSlide 0.35s var(--ease);
}

.onboard-step.is-active {
  display: block;
}

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

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.choice-chip {
  appearance: none;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 0.8rem;
  padding: 0.85rem 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-blue);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}

.choice-chip:hover {
  border-color: rgba(47, 191, 113, 0.35);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.choice-chip.is-selected {
  border-color: rgba(47, 191, 113, 0.55);
  background: rgba(47, 191, 113, 0.08);
  color: #0f5132;
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.12);
}

.choice-list {
  display: grid;
  gap: 0.55rem;
}

.choice-card {
  appearance: none;
  width: 100%;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 0.85rem;
  padding: 0.95rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  text-align: left;
}

.choice-card:hover {
  border-color: rgba(47, 191, 113, 0.35);
}

.choice-card.is-selected {
  border-color: rgba(47, 191, 113, 0.55);
  background: rgba(47, 191, 113, 0.07);
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.1);
}

.choice-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-blue);
}

.choice-card-check {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  border: 1.5px solid var(--color-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  flex-shrink: 0;
}

.choice-card.is-selected .choice-card-check {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
}

.level-group {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.level-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.level-option:hover {
  border-color: rgba(47, 191, 113, 0.35);
}

.level-option.is-selected {
  border-color: rgba(47, 191, 113, 0.55);
  background: rgba(47, 191, 113, 0.07);
}

.level-option input {
  accent-color: var(--color-green);
  width: 1rem;
  height: 1rem;
}

.level-option span {
  font-weight: 600;
  color: var(--color-blue);
  font-size: 0.95rem;
}

.onboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.75rem;
}

.onboard-actions .btn {
  flex: 1;
  min-width: 8rem;
}

.search-suggest {
  margin-top: 0.85rem;
}

/* ---------- Welcome ---------- */
.welcome-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 55% 45% at 70% 20%, rgba(47, 191, 113, 0.12), transparent 55%),
    radial-gradient(ellipse 40% 35% at 15% 80%, rgba(18, 59, 99, 0.05), transparent 50%),
    #f4f7fa;
}

.welcome-card {
  width: 100%;
  max-width: 30rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1.35rem;
  box-shadow: var(--shadow-elevated);
  padding: 2.5rem 1.75rem;
}

.success-burst {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.5rem;
  border-radius: 999px;
  background: rgba(47, 191, 113, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  animation: popIn 0.55s var(--ease);
}

.success-burst-inner {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 999px;
  background: var(--color-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -10px rgba(47, 191, 113, 0.55);
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- Dashboard placeholder ---------- */
.dash-shell {
  min-height: 100vh;
  background: var(--color-light);
}

.dash-top {
  height: 4rem;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad-x, 1.25rem);
  position: sticky;
  top: 0;
  z-index: 20;
}

.dash-content {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 2rem var(--page-pad-x) 3rem;
}

.theme-toggle-btn {
  gap: 0.35rem;
}

.quest-banner {
  border-radius: 1.15rem;
  border: 1px solid rgba(44, 193, 116, 0.25);
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(44, 193, 116, 0.14), transparent 55%),
    var(--color-surface);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

[data-theme='dark'] .auth-main,
[data-theme='dark'] .onboard-shell,
[data-theme='dark'] .welcome-shell,
[data-theme='dark'] .dash-shell {
  background: var(--color-light);
}

[data-theme='dark'] .auth-card,
[data-theme='dark'] .onboard-card,
[data-theme='dark'] .welcome-card,
[data-theme='dark'] .choice-chip,
[data-theme='dark'] .choice-card,
[data-theme='dark'] .field-input,
[data-theme='dark'] .level-option,
[data-theme='dark'] .quest-banner {
  background: var(--color-surface);
  color: var(--color-text);
}

[data-theme='dark'] .onboard-top {
  border-bottom-color: var(--color-border);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}
