/* =========================================
   AUTHENTICATION PAGES — DARK THEME
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --auth-bg:          #160820;       /* deep dark purple */
  --auth-surface:     rgba(255, 255, 255, 0.06);  /* subtle field fill */
  --auth-border:      rgba(255, 255, 255, 0.22);  /* field border */
  --auth-border-focus:rgba(255, 255, 255, 0.55);
  --auth-text:        #ffffff;
  --auth-muted:       rgba(255, 255, 255, 0.45);
  --auth-placeholder: rgba(255, 255, 255, 0.35);
  --auth-accent:      #ffffff;       /* primary button fill */
  --auth-accent-text: #160820;       /* text on white button */
  --auth-radius-pill: 50px;
  --auth-radius-field:14px;
  --auth-error:       #ff6b6b;
}

/* ── CONTAINER ── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--auth-bg);
  padding: 3rem 1.5rem;
  font-family: 'Nunito', sans-serif;
}

.auth-wrapper {
  width: 100%;
  max-width: 480px;
}

/* ── LOGO / HEADER ── */
.auth-logo {
  margin-bottom: 2.5rem;
}

.auth-logo img {
  width: 60px;
  height: 60px;
  margin-bottom: 1.5rem;
  display: block;
}

.auth-logo h1 {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--auth-text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.auth-logo p {
  color: var(--auth-muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

/* ── ALERTS ── */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--auth-radius-field);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-success {
  background: rgba(81, 207, 102, 0.12);
  color: #69db7c;
  border: 1px solid rgba(81, 207, 102, 0.3);
}

.alert-error {
  background: rgba(255, 107, 107, 0.12);
  color: var(--auth-error);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ── FORM ── */
.auth-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--auth-text);
  margin-bottom: 0.55rem;
  letter-spacing: 0.01em;
}

/* ── INPUT FIELDS ── */
.form-control {
  width: 100%;
  padding: 1rem 1.4rem;
  border-radius: var(--auth-radius-pill);
  border: 1.5px solid var(--auth-border);
  background: var(--auth-surface);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--auth-text);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.form-control::placeholder {
  color: var(--auth-placeholder);
  font-weight: 600;
}

.form-control:focus {
  border-color: var(--auth-border-focus);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

.form-control.error {
  border-color: rgba(255, 107, 107, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* autofill fix */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #200c35 inset;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
}

.form-error {
  font-size: 0.78rem;
  color: var(--auth-error);
  margin-top: 0.4rem;
  font-weight: 700;
  padding-left: 1rem;
}

/* ── PASSWORD WRAPPER ── */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrapper .form-control {
  padding-right: 3.2rem;
}

.password-toggle-btn {
  position: absolute;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.9rem;
  transition: color 0.2s;
  line-height: 1;
}

.password-toggle-btn:hover {
  color: var(--auth-text);
}

/* ── REMEMBER / FORGOT ── */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  font-size: 0.85rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #9b7ffa;
  cursor: pointer;
  border-radius: 4px;
}

.checkbox-group label {
  color: var(--auth-muted);
  font-weight: 700;
  cursor: pointer;
}

.remember-forgot a {
  color: var(--auth-muted);
  font-weight: 800;
  text-decoration: none;
  transition: color 0.2s;
}

.remember-forgot a:hover {
  color: var(--auth-text);
}

/* ── PRIMARY BUTTON (white pill) ── */
.btn.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--auth-radius-pill);
  background: var(--auth-accent);
  color: var(--auth-accent-text);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn.btn-primary:hover:not(:disabled) {
  background: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.btn.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ── DIVIDER ── */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.75rem 0;
  color: var(--auth-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider span {
  padding: 0 1rem;
}

/* ── SOCIAL BUTTONS ── */
.social-auth {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 1.5rem;
  background: transparent;
  color: var(--auth-text);
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius-pill);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.btn-social:hover {
  border-color: var(--auth-border-focus);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.btn-social:active {
  transform: translateY(0);
}

.btn-social img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ── FOOTER ── */
.auth-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--auth-muted);
  font-weight: 700;
}

.auth-footer a {
  color: var(--auth-text);
  font-weight: 800;
  text-decoration: none;
  transition: opacity 0.2s;
}

.auth-footer a:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* ── LOADING STATE ── */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 2.5px solid rgba(22, 8, 32, 0.3);
  border-top-color: var(--auth-accent-text);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── PASSWORD STRENGTH ── */
.password-strength {
  margin-top: 0.5rem;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 50px;
}

.password-strength-bar.weak   { width: 33%; background: #ff6b6b; }
.password-strength-bar.medium { width: 66%; background: #ffa94d; }
.password-strength-bar.strong { width: 100%; background: #51cf66; }

.password-strength-text {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  color: var(--auth-muted);
  font-weight: 700;
  padding-left: 1rem;
}

/* ── MOBILE ── */
@media (max-width: 520px) {
  .auth-container {
    padding: 2rem 1.25rem;
    align-items: flex-start;
    padding-top: 3rem;
  }

  .auth-logo h1 {
    font-size: 2rem;
  }

  .form-control {
    font-size: 0.9rem;
  }
}