/* ============================================================
   COSMOS DIGITAL NETWORKS — auth.css
   Shared styles for: login, register, forgot-password,
   reset-password pages.

   Requires: style.css (loaded first).

   Reused from style.css (zero redefinition here):
     • CSS variables  (--color-*, --font-*, --shadow-card,
                       --radius-card, --transition-base, --header-height)
     • .anim-fade-up  (entrance animation)
   ============================================================ */


/* ------------------------------------------------------------
   1. PAGE LAYOUT
   ------------------------------------------------------------ */
.auth-body {
  background: var(--color-gray-50);
}

.auth-page {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  padding: 48px 0;
}

/* Wide variant — register page needs more breathing room */
.auth-page--wide {
  align-items: flex-start;
  padding: 48px 0 64px;
}

.auth-center {
  display: flex;
  justify-content: center;
  width: 100%;
}


/* ------------------------------------------------------------
   2. AUTH CARD
   ------------------------------------------------------------ */
.auth-card {
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  text-align: center;
}

/* Wide card for register — matches multi-column field layout */
.auth-card--wide {
  max-width: 780px;
}


/* ------------------------------------------------------------
   3. BRAND / LOGO
   ------------------------------------------------------------ */
.auth-brand {
  margin-bottom: 28px;
}

.auth-logo {
  height: 52px;
  width: auto;
  mix-blend-mode: multiply;
}


/* ------------------------------------------------------------
   4. HEADINGS & SUB-TEXT
   ------------------------------------------------------------ */
.auth-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
  line-height: 1.2;
}

.auth-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--color-gray-500);
  margin-bottom: 28px;
  line-height: 1.6;
}


/* ------------------------------------------------------------
   5. FORM FIELDS
   ------------------------------------------------------------ */
.auth-field {
  margin-bottom: 20px;
  text-align: left;
}

/* Remove bottom margin when field is inside a Bootstrap row/col
   — the row gap handles spacing instead                        */
.row .auth-field {
  margin-bottom: 0;
}

.auth-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-gray-700);
  margin-bottom: 6px;
}

/* Required asterisk */
.auth-required {
  color: #dc3545;
  margin-left: 2px;
}

/* Input wrapper — icon left, optional toggle right */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  color: var(--color-gray-400);
  pointer-events: none;
  z-index: 1;
}

.auth-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-gray-800);
  background: var(--color-gray-50);
  border: 1.5px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 12px 44px;
  outline: none;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.auth-input::placeholder {
  color: var(--color-gray-400);
  font-weight: 400;
}

.auth-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 201, 2, 0.14);
  background: var(--color-white);
}

.auth-input.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

/* ── Date input — keep icon visible, remove browser chrome padding clash */
.auth-input--date {
  padding-right: 12px; /* date picker arrow sits at right edge natively */
  cursor: pointer;
}

/* ── Select — same look as text inputs */
.auth-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  /* Right-side chevron via background SVG */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px; /* room for chevron */
}

.auth-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 201, 2, 0.14);
  background-color: var(--color-white);
}

/* Password show/hide toggle */
.auth-toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-400);
  font-size: 0.95rem;
  padding: 4px;
  line-height: 1;
  transition: color var(--transition-base);
}

.auth-toggle-pw:hover { color: var(--color-primary); }

/* Inline error messages */
.auth-error {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #dc3545;
  margin-top: 5px;
  min-height: 18px;
}


/* ------------------------------------------------------------
   6. PASSWORD STRENGTH BAR
   ------------------------------------------------------------ */
.pw-strength-bar {
  height: 4px;
  background: var(--color-gray-200);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.4s ease, background 0.4s ease;
}

.pw-strength-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  margin-top: 4px;
  font-weight: 500;
}


/* ------------------------------------------------------------
   7. CHECKBOX
   ------------------------------------------------------------ */
.auth-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.auth-checkbox-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-gray-600);
  cursor: pointer;
  line-height: 1.5;
}


/* ------------------------------------------------------------
   8. SUBMIT BUTTON
   ------------------------------------------------------------ */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
  text-decoration: none;
  transition:
    background var(--transition-base),
    transform var(--transition-base);
}

.auth-btn:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  transform: scale(1.02);
}

.auth-btn:disabled {
  background: var(--color-gray-300);
  cursor: not-allowed;
  transform: none;
}

.auth-btn-icon {
  transition: transform var(--transition-base);
}

.auth-btn:hover .auth-btn-icon {
  transform: translateX(4px);
}


/* ------------------------------------------------------------
   9. LINKS
   ------------------------------------------------------------ */
.auth-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-primary-dark);
  transition: color var(--transition-base);
  text-decoration: none;
}

.auth-link:hover { color: var(--color-primary); }

.auth-link-bold { font-weight: 700; }

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: inherit;
  color: var(--color-primary-dark);
  font-weight: 700;
  transition: color var(--transition-base);
}

.auth-link-btn:hover { color: var(--color-primary); }


/* ------------------------------------------------------------
   10. DIVIDER  "— or —"
   ------------------------------------------------------------ */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--color-gray-400);
  font-family: var(--font-body);
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-gray-200);
}


/* ------------------------------------------------------------
   11. SOCIAL LOGIN BUTTONS
   ------------------------------------------------------------ */
.auth-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--color-gray-200);
  background: var(--color-white);
  color: var(--color-gray-700);
  cursor: pointer;
  transition:
    border-color var(--transition-base),
    background var(--transition-base),
    color var(--transition-base);
}

.auth-social-btn:hover {
  border-color: var(--color-primary);
  background: rgba(41, 201, 2, 0.05);
  color: var(--color-primary-dark);
}


/* ------------------------------------------------------------
   12. FOOTER TEXT
   ------------------------------------------------------------ */
.auth-footer-text {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-top: 20px;
  margin-bottom: 0;
}


/* ------------------------------------------------------------
   13. ICON CIRCLES  (Forgot / Reset pages)
   ------------------------------------------------------------ */
.auth-icon-circle {
  width: 72px;
  height: 72px;
  background: rgba(41, 201, 2, 0.1);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--color-primary);
}

.auth-success-icon {
  width: 72px;
  height: 72px;
  background: rgba(41, 201, 2, 0.1);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--color-primary);
  animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes successPop {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}


/* ------------------------------------------------------------
   14. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 575.98px) {
  .auth-card        { padding: 36px 20px; }
  .auth-card--wide  { padding: 32px 16px; }
  .auth-title       { font-size: 1.4rem; }
  .auth-social-row  { grid-template-columns: 1fr; }
}