/* ══════════════════════════════════════════════════════════════════
   Rising Edge Technologies — Shared Auth Page Styles
   Applies to: login.html · register.html · forgot-password.html
               · verify-email.html
══════════════════════════════════════════════════════════════════ */

/* ── Page resets ─────────────────────────────────────────────── */
body {
  padding-bottom: 0;
  min-height: 100vh;
}
#global-nav,
#global-footer,
#global-bottom-nav {
  display: none;
}
/* core.js injects an .auth-topbar nav element — hide it */
.auth-topbar {
  display: none !important;
}

/* ── Split layout ─────────────────────────────────────────────── */
.auth-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── LEFT brand panel ─────────────────────────────────────────── */
.auth-brand {
  display: none;
  width: 44%;
  flex-shrink: 0;
  background: linear-gradient(160deg, #060d1a 0%, #09152a 55%, #060d1a 100%);
  border-right: 1px solid var(--border);
  padding: 40px 48px;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
@media (min-width: 900px) {
  .auth-brand {
    display: flex;
  }
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 40%, transparent 100%);
}
.auth-brand::after {
  content: '';
  position: absolute;
  top: -120px;
  left: -120px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.brand-top {
  position: relative;
  z-index: 1;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}
.brand-logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
}
.brand-headline {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  color: var(--text-base);
  position: relative;
  z-index: 1;
}
.brand-headline span {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 340px;
  position: relative;
  z-index: 1;
}

.brand-features {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand-feat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.brand-feat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.25);
}
.brand-feat-body strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-base);
  margin-bottom: 3px;
}
.brand-feat-body span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.brand-bottom {
  position: relative;
  z-index: 1;
}
.brand-quote {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan-400);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.brand-quote p {
  font-size: 0.875rem;
  color: var(--text-sub);
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 10px;
}
.brand-quote-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-quote-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-600), var(--cyan-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.brand-quote-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-base);
}
.brand-quote-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.brand-wave {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  opacity: 0.12;
  pointer-events: none;
}

/* ── RIGHT form panel ─────────────────────────────────────────── */
.auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg-page);
  position: relative;
}

/* top-bar: mobile logo + theme toggle */
.auth-topbar-real {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-topbar-logo img {
  height: 30px;
  width: auto;
}
@media (min-width: 900px) {
  .auth-topbar-logo {
    opacity: 0;
    pointer-events: none;
  }
}

.auth-theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-base);
  flex-shrink: 0;
}
.auth-theme-btn:hover {
  background: var(--bg-hover);
  color: var(--text-base);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-heading {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-base);
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ── Form elements ────────────────────────────────────────────── */
.field-wrap {
  position: relative;
}
.field-wrap .input {
  padding-right: 44px;
}
.field-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color var(--dur-base);
}
.field-icon:hover {
  color: var(--text-sub);
}
.pw-toggle {
  cursor: pointer;
}

/* ── Error / validation state ─────────────────────────────────── */
.input.error {
  border-color: var(--danger);
}
.input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.field-err {
  display: none;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 5px;
}
.field-err.show {
  display: block;
}

/* ── Checkbox / remember me ───────────────────────────────────── */
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  color: var(--text-sub);
}
.check-label input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-500);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Form row (remember + forgot) ────────────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-link {
  font-size: 0.875rem;
  color: var(--primary-400);
  text-decoration: none;
  transition: color var(--dur-base);
}
.form-link:hover {
  color: var(--primary-300);
  text-decoration: underline;
}

/* ── Divider ──────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Social buttons ───────────────────────────────────────────── */
.social-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.625rem;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border-med);
  color: var(--text-sub);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-base);
}
.btn-social:hover {
  background: var(--bg-hover);
  color: var(--text-base);
  border-color: var(--border-str);
}

/* ── Alert banner ─────────────────────────────────────────────── */
.auth-alert {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 20px;
  border: 1px solid;
}
.auth-alert.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.auth-alert.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}
.auth-alert.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Loading spinner on submit button ────────────────────────── */
.btn-loading {
  pointer-events: none;
}
.btn-loading .btn-text {
  opacity: 0;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}
.btn-submit-wrap {
  position: relative;
  display: flex;
}
.btn-submit-wrap .btn {
  flex: 1;
  position: relative;
}

/* ── Footer link (already have an account? / sign up) ────────── */
.auth-footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.auth-footer-link a {
  color: var(--primary-400);
  text-decoration: none;
  font-weight: 600;
}
.auth-footer-link a:hover {
  text-decoration: underline;
}

/* ── Back link ────────────────────────────────────────────────── */
.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 16px;
  transition: color var(--dur-base);
}
.back-link:hover {
  color: var(--text-base);
}

/* ── Resend note ──────────────────────────────────────────────── */
.resend-note {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 14px;
}
.resend-note button {
  background: none;
  border: none;
  color: var(--primary-400);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0;
}
.resend-note button:hover {
  text-decoration: underline;
}

/* ── Verify-page states ───────────────────────────────────────── */
.state {
  display: none;
}
.state.active {
  display: block;
}

/* ── Form group spacing ───────────────────────────────────────── */
.auth-form .form-group {
  margin-bottom: 18px;
}
.auth-form .form-group:last-of-type {
  margin-bottom: 0;
}
