/* =========================================================
   Lectura Biónica — auth.css
   Auth pages: login, register, verify, email templates
   Uses tokens from styles.css
   ========================================================= */

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(91, 91, 214, .18);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(91, 91, 214, 0);
  }
}

@keyframes float-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- AUTH PAGE LAYOUT ---------- */
.auth-section {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.auth-card {
  max-width: 460px;
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 48px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp .5s var(--ease) both;
  position: relative;
}

/* Subtle gradient top border accent */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: .6;
}

/* ---------- AUTH HEADER ---------- */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.auth-logo::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--ink-mute);
  margin: 0;
  line-height: 1.5;
}

/* ---------- FORM FIELDS ---------- */
.auth-field {
  margin-bottom: 20px;
}

.auth-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition:
    border-color .2s var(--ease),
    box-shadow .2s var(--ease),
    background .2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.auth-input::placeholder {
  color: var(--ink-mute);
  opacity: .5;
}

.auth-input:hover {
  border-color: #cfc8ba;
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, .12);
  background: var(--bg-elev);
}

.auth-input.has-error {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 106, 75, .1);
}

/* ---------- PASSWORD FIELD ---------- */
.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-input {
  padding-right: 50px;
}

.auth-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-mute);
  border-radius: var(--r-sm);
  transition: color .2s var(--ease), background .2s var(--ease);
  padding: 0;
}

.auth-password-toggle:hover {
  color: var(--ink);
  background: rgba(31, 27, 22, .05);
}

.auth-password-toggle svg {
  width: 20px;
  height: 20px;
}

/* ---------- MESSAGES / ALERTS ---------- */
.auth-alert {
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.auth-alert--error {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid rgba(242, 106, 75, .2);
}

.auth-alert--success {
  background: var(--mint-soft);
  color: #2d7a5a;
  border: 1px solid rgba(111, 191, 155, .2);
}

/* ---------- SUBMIT BUTTON ---------- */
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 16px;
  font-size: 16px;
  margin-top: 8px;
  border-radius: var(--r-md);
}

.auth-submit .arrow {
  transition: transform .25s var(--ease);
}

.auth-submit:hover .arrow {
  transform: translateX(3px);
}

/* ---------- LINKS ---------- */
.auth-link {
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 500;
  text-decoration: none;
  transition: color .2s var(--ease);
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

.auth-link:hover {
  color: var(--primary-deep);
  text-decoration: underline;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--ink-mute);
}

.auth-footer p {
  margin: 0;
  color: var(--ink-mute);
}

/* ---------- RESEND SECTION ---------- */
.auth-resend {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.auth-resend p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink-mute);
}

.auth-resend form {
  display: inline;
}

.auth-resend-form {
  margin-top: 28px;
}

/* ---------- DIVIDER ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--ink-mute);
  font-size: 13px;
  font-weight: 500;
}

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

/* ---------- FIELD HINT / HELPER TEXT ---------- */
.auth-hint {
  display: block;
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 6px;
  line-height: 1.4;
}

.auth-hint.has-error {
  color: var(--accent-deep);
}

/* ---------- PASSWORD STRENGTH ---------- */
.auth-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.auth-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background .3s var(--ease);
}

.auth-strength[data-level="1"] .auth-strength-bar:nth-child(1) { background: var(--accent); }
.auth-strength[data-level="2"] .auth-strength-bar:nth-child(-n+2) { background: #e6a817; }
.auth-strength[data-level="3"] .auth-strength-bar:nth-child(-n+3) { background: #8fb846; }
.auth-strength[data-level="4"] .auth-strength-bar { background: var(--mint); }

.auth-strength-text {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  color: var(--ink-mute);
  transition: color .3s var(--ease);
}

/* ---------- VERIFICATION PENDING PAGE ---------- */
.auth-verify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--primary-soft);
  margin-bottom: 24px;
  animation: pulse-glow 2.5s var(--ease) infinite;
}

.auth-verify-icon svg {
  width: 40px;
  height: 40px;
  color: var(--primary);
  animation: float-bounce 3s var(--ease) infinite;
}

.auth-verify-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.auth-verify-text {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 8px;
}

.auth-verify-hint {
  font-size: 14px;
  color: var(--ink-mute);
  margin: 0 0 28px;
}

/* ---------- HEADER AUTH STATE ---------- */
.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-auth-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mute);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-auth-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  text-decoration: none;
  transition: color .2s var(--ease), background .2s var(--ease);
}

.header-auth-logout:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-auth-logout svg {
  width: 18px;
  height: 18px;
}

.header-auth-login {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  transition:
    color .2s var(--ease),
    border-color .2s var(--ease),
    background .2s var(--ease);
}

.header-auth-login:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .auth-section {
    padding: 32px 16px;
    min-height: calc(100vh - 160px);
  }

  .auth-card {
    padding: 32px 24px;
    border-radius: var(--r-lg);
  }

  .auth-card::before {
    left: 20px;
    right: 20px;
  }

  .auth-title,
  .auth-verify-title {
    font-size: 1.5rem;
  }

  .auth-logo {
    width: 44px;
    height: 44px;
    font-size: 18px;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .auth-logo::after {
    width: 8px;
    height: 8px;
    right: 5px;
    bottom: 5px;
  }

  .auth-verify-icon {
    width: 72px;
    height: 72px;
  }

  .auth-verify-icon svg {
    width: 32px;
    height: 32px;
  }

  .header-auth-name {
    display: none;
  }

  .header-auth-login {
    font-size: 13px;
    padding: 6px 12px;
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding: 24px 18px;
  }
}

/* ---------- CHECKBOX / REMEMBER ME ---------- */
.auth-remember-wrap {
  display: flex;
  align-items: center;
  margin-top: 16px;
  margin-bottom: 28px;
}

.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.auth-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.auth-checkbox:hover {
  border-color: #cfc8ba;
}

.auth-checkbox:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, .12);
}

.auth-checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.auth-checkbox:checked::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -1px);
  top: 4px;
  left: 3px;
}

