﻿/*
  File: auth.css
  Shared authentication stylesheet for login, verification, forgot password, and reset password pages
*/

/* =========================================================
   Auth page foundation
========================================================= */
.auth-page {
  min-height: 100vh;
  background: #101617;
  color-scheme: dark;
}

.auth-page .layout {
  min-height: calc(100vh - 80px);
}

.auth-page .container {
  position: relative;
  z-index: 1;
}

@keyframes auth-icon-signal {
  0%, 100% { transform: translateY(0) scale(1); color: #67e8f9; }
  38% { transform: translateY(-6px) scale(1.18); color: #86efac; }
  56% { transform: translateY(0) scale(1.06); color: #f9a8d4; }
}

@keyframes auth-status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 183, 0.42); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(110, 231, 183, 0); }
}
/* =========================================================
   Main auth card
========================================================= */
.auth-shell {
  position: relative;
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  border: 1px solid #3c4b4b;
  border-top: 3px solid #a6e5cc;
  background: #1b2527;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  overflow-wrap: anywhere;
}

.auth-title {
  color: #fff;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.08;
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-sub {
  color: rgba(226, 232, 240, 0.74);
  margin-bottom: 0;
  line-height: 1.62;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-brand {
  color: rgba(226, 232, 240, 0.68);
  font-weight: 800;
  letter-spacing: 0;
}

/* =========================================================
   Form controls
========================================================= */
.auth-shell .form-label {
  color: rgba(248, 250, 252, 0.90);
  font-weight: 800;
  line-height: 1.35;
}

.auth-shell .form-control,
.auth-shell .form-select,
.auth-shell textarea {
  min-height: 48px;
  border-color: #637171;
  background: #111a1c;
  color: #fff;
  border-radius: 6px;
  font-size: 1rem;
  box-shadow: none;
}

.auth-shell .form-control::placeholder,
.auth-shell textarea::placeholder {
  color: #a9b6b7;
}

.auth-shell .form-control:focus,
.auth-shell .form-select:focus,
.auth-shell textarea:focus {
  border-color: #a6e5cc;
  box-shadow: 0 0 0 3px rgba(166, 229, 204, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.auth-shell .form-control.is-invalid,
.auth-shell .form-select.is-invalid {
  border-color: rgba(220, 53, 69, 0.94);
  box-shadow: 0 0 0 0.18rem rgba(220, 53, 69, 0.17);
  background-image: none;
}

.auth-shell .input-group {
  border-radius: 6px;
}

.auth-shell .input-group-text {
  border-color: #637171;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.86);
  border-radius: 6px 0 0 6px;
}

.auth-shell .input-group .form-control {
  border-radius: 0;
}

.auth-shell .input-group .form-control:last-child,
.auth-shell .input-group .btn:last-child {
  border-radius: 0 6px 6px 0;
}

.auth-shell .input-group .btn {
  border-color: #637171;
  min-width: 48px;
}

.input-group-text i,
.btn i {
  line-height: 1;
}

/* =========================================================
   Buttons
========================================================= */
.auth-shell .btn {
  border-radius: 6px;
  min-height: 44px;
  font-weight: 850;
  line-height: 1.25;
  white-space: normal;
}

.auth-shell .btn-lg {
  min-height: 50px;
}

.auth-shell .btn-primary {
  background: #a6e5cc;
  border-color: #a6e5cc;
  color: #10231c;
  box-shadow: none;
}

.auth-shell .btn-primary:hover {
  background: #c2f1de;
  border-color: #c2f1de;
}

.auth-shell :is(a, button, input):focus-visible {
  outline: 3px solid #a6e5cc;
  outline-offset: 3px;
}

.auth-shell .btn-outline-secondary,
.auth-shell .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.86);
}

.auth-shell .btn-outline-secondary:hover,
.auth-shell .btn-outline-secondary:focus,
.auth-shell .btn-outline-light:hover,
.auth-shell .btn-outline-light:focus {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* =========================================================
   Alerts and feedback
========================================================= */
.auth-shell .alert {
  border-radius: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
  border-width: 1px;
}

.auth-shell .alert-danger {
  border-color: rgba(220, 53, 69, 0.36);
  background: rgba(220, 53, 69, 0.13);
  color: #ffe4e6;
}

.auth-shell .alert-success {
  border-color: rgba(32, 201, 151, 0.32);
  background: rgba(32, 201, 151, 0.11);
  color: #d1fae5;
}

.auth-shell .alert-warning {
  border-color: rgba(255, 193, 7, 0.32);
  background: rgba(255, 193, 7, 0.11);
  color: #fff3cd;
}

.auth-shell .alert-info {
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(96, 165, 250, 0.11);
  color: #dbeafe;
}

.auth-field-error,
.field-error {
  color: #fecdd3;
  font-size: 0.92rem;
  margin-top: 0.55rem;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   Hints, notes, and panels
========================================================= */
.auth-hint,
.auth-note {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.92rem;
  line-height: 1.62;
  border: 0;
  border-left: 2px solid #769e95;
  border-radius: 0;
  padding: 0.15rem 0 0.15rem 0.8rem;
  background: transparent;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-note {
  margin-top: 0.75rem;
}

.auth-panel,
.auth-method-switch,
.auth-checkbox {
  border: 0;
  border-block: 1px solid #3c4b4b;
  background: transparent;
  border-radius: 0;
  padding: 0.85rem 0;
}

.auth-panel-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.36rem 0;
}

.auth-panel-row + .auth-panel-row {
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.auth-panel-row .k {
  color: rgba(226, 232, 240, 0.66);
  font-size: 0.92rem;
  line-height: 1.45;
  flex: 0 0 auto;
}

.auth-panel-row .v {
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.94rem;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex: 1 1 auto;
  font-weight: 800;
}

.auth-method-switch .auth-note {
  margin-top: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.auth-checkbox .form-check-input {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.auth-checkbox .form-check-input:checked {
  background-color: #4f83ff;
  border-color: #4f83ff;
}

.auth-checkbox .form-check-label {
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   Links
========================================================= */
.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.auth-links a,
.auth-links .auth-link-button {
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  font-weight: 760;
  font-size: 0.95rem;
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  cursor: pointer;
}

.auth-links a:hover,
.auth-links a:focus,
.auth-links .auth-link-button:hover,
.auth-links .auth-link-button:focus {
  color: #fff;
  text-decoration: underline;
}

.auth-link-button:focus-visible {
  outline: 2px solid var(--yb-accent, #7fcfff);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

/* =========================================================
   Verification method and silent protection
========================================================= */
.auth-method-choice {
  min-width: 0;
  border: 0;
  padding: 0.6rem 0;
  min-height: 44px;
  margin: 0;
}

.auth-method-choice__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.auth-method-choice legend {
  font-size: 1rem;
  line-height: 1.5;
}

.auth-method-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  min-height: 76px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 0.65rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-method-option:hover {
  border-color: rgba(125, 211, 252, 0.42);
}

.auth-method-option:has(input:checked) {
  border-color: rgba(110, 231, 183, 0.56);
  background: rgba(52, 211, 153, 0.09);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.1);
}

.auth-method-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.auth-method-option:focus-within {
  outline: 2px solid rgba(125, 211, 252, 0.85);
  outline-offset: 2px;
}

.auth-method-option__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: rgba(125, 211, 252, 0.08);
  color: #7dd3fc;
  flex: 0 0 auto;
}

.auth-method-option strong,
.auth-method-option small {
  display: block;
  overflow-wrap: anywhere;
}

.auth-method-option strong {
  color: #f8fafc;
  font-size: 0.88rem;
  line-height: 1.24;
}

.auth-method-option small {
  margin-top: 0.16rem;
  color: #bbc8ca;
  font-size: 0.8rem;
  line-height: 1.3;
}

.auth-method-option__check {
  color: #86efac;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.auth-method-option:has(input:checked) .auth-method-option__check,
.auth-method-option input:checked ~ .auth-method-option__check {
  opacity: 1;
  transform: scale(1);
}

.auth-human-check {
  margin: 0 0 0.75rem;
}

.auth-human-check__feedback {
  border: 1px solid rgba(251, 113, 133, 0.44);
  border-radius: 8px;
  background: rgba(190, 24, 93, 0.13);
  color: #ffe4e6;
  padding: 0.72rem 0.8rem;
  font-weight: 700;
  line-height: 1.45;
}

.auth-turnstile {
  max-width: 100%;
}

/* =========================================================
   OTP verification
========================================================= */
.otp-single-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-shell .otp-single-input {
  width: 100%;
  min-height: 72px;
  padding: 0.72rem 3rem 0.72rem 1rem;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.55);
  color: #f8fafc;
  text-align: center;
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  caret-color: #86efac;
}

.auth-shell .otp-single-input:focus {
  border-color: rgba(110, 231, 183, 0.68);
  box-shadow: 0 0 0 0.24rem rgba(52, 211, 153, 0.12), 0 15px 34px rgba(0, 0, 0, 0.16);
}

.otp-single-status {
  position: absolute;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #86efac;
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.otp-single-input:valid + .otp-single-status {
  opacity: 1;
  transform: scale(1);
}

.auth-inline-feedback {
  min-height: 1.4em;
  margin-top: 0.5rem;
  color: #fecdd3;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.4;
}

/* =========================================================
   Utility
========================================================= */
.auth-break {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 575.98px) {
  .auth-panel-row {
    flex-direction: column;
    gap: 0.18rem;
  }

  .auth-panel-row .v {
    text-align: left;
  }

  .auth-method-switch .btn {
    width: 100%;
  }

  .auth-shell .btn {
    white-space: normal;
  }

  .auth-method-option {
    grid-template-columns: 1fr auto;
    align-content: start;
    min-height: 112px;
    gap: 0.38rem;
  }

  .auth-method-option__icon {
    grid-column: 1;
    width: 34px;
    height: 34px;
  }

  .auth-method-option > span:nth-of-type(2) {
    grid-column: 1 / -1;
  }

  .auth-method-option__check {
    grid-column: 2;
    grid-row: 1;
  }

}

/* Shared, centered account journey for sign-in and recovery pages. */
.auth-experience {
  display: block;
}

.auth-flow {
  margin: 0 0 1.25rem;
}

.auth-flow__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #a8edcf;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-flow__kicker span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
  animation: auth-status-pulse 2.2s ease-out infinite;
}

.auth-flow__copy {
  margin: 0.5rem 0 0;
  color: rgba(226, 232, 240, 0.76);
  font-size: 0.86rem;
  line-height: 1.48;
}

.auth-flow__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.9rem;
  border-block: 1px solid #4b5b5c;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.auth-flow__step {
  display: flex;
  min-width: 0;
  min-height: 96px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.2rem;
  gap: 0.2rem;
  text-align: center;
  border-right: 1px solid rgba(148, 163, 184, 0.3);
}

.auth-flow__step:last-child {
  border-right: 0;
}

.auth-flow__step i {
  color: #9de6ce;
  font-size: 1.25rem;
  line-height: 1.2;
  animation: auth-icon-signal 3.1s ease-in-out var(--auth-step-delay, 0s) infinite;
}

.auth-flow__step strong,
.auth-flow__step small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.26;
}

.auth-flow__step strong {
  color: #f8fafc;
  font-size: 0.82rem;
}

.auth-flow__step small {
  margin-top: 0.12rem;
  color: rgba(203, 213, 225, 0.76);
  font-size: 0.75rem;
}

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

  .auth-flow__step {
    min-height: 100px;
  }

  .auth-flow__step i {
    font-size: 1.5rem;
  }

  .auth-flow__step strong {
    font-size: 0.84rem;
  }

  .auth-flow__step small {
    font-size: 0.8rem;
  }
}

/* =========================================================
   Motion safety
========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .auth-flow__kicker span,
  .auth-flow__step i {
    animation: none !important;
  }

  .spinner-border {
    animation-duration: 1.2s !important;
    animation-iteration-count: infinite !important;
  }
}
