/* ============================================================
   AUTH.CSS — Creviz Studio
   Shared styles for signin.html and signup.html
   Theme : Dark + Fire (Red → Orange → Yellow)
============================================================ */

/* ---- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: #0c0a09;
  color: #f0ece8;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
  overflow-x: hidden;
  /* body starts visible on auth pages — no loader */
  opacity: 1;
}

a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

:focus-visible {
  outline: 2px solid #ff6b1a;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- CSS Variables ---------------------------------------- */
:root {
  --fire:    linear-gradient(135deg, #ff2d2d, #ff6b1a, #ffc93c);
  --orange:  #ff6b1a;
  --red:     #ff2d2d;
  --yellow:  #ffc93c;
  --glow:    rgba(255, 107, 26, .35);
  --bg:      #0c0a09;
  --bg2:     #1a1410;
  --bg3:     #110e0b;
  --border:  rgba(255, 255, 255, .09);
  --text:    #f0ece8;
  --muted:   #9e9189;
  --success: #4ade80;
  --error:   #ff4d4d;
  --r-sm:    6px;
  --r-md:    12px;
  --r-lg:    20px;
  --r-xl:    30px;
  --t:       all .3s ease;
  --t-sp:    all .4s cubic-bezier(.34, 1.56, .64, 1);
}

/* ---- Scrollbar -------------------------------------------- */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--fire); border-radius: 6px; }

/* ---- Accent text ------------------------------------------ */
.accent-text {
  background: var(--fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ============================================================
   PAGE BACKGROUND
============================================================ */
.auth-page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  animation: orb-drift ease-in-out infinite alternate;
}

.auth-orb-1 {
  width: 500px; height: 500px;
  top: -160px; left: -140px;
  background: radial-gradient(circle,
    rgba(255, 45, 45, .12) 0%, transparent 70%);
  animation-duration: 12s;
}

.auth-orb-2 {
  width: 420px; height: 420px;
  bottom: -140px; right: -100px;
  background: radial-gradient(circle,
    rgba(255, 107, 26, .11) 0%, transparent 70%);
  animation-duration: 15s;
  animation-delay: -5s;
}

.auth-orb-3 {
  width: 280px; height: 280px;
  top: 40%; left: 55%;
  background: radial-gradient(circle,
    rgba(255, 201, 60, .08) 0%, transparent 70%);
  animation-duration: 9s;
  animation-delay: -3s;
}

@keyframes orb-drift {
  from { transform: translate(0, 0)       scale(1); }
  to   { transform: translate(25px, -35px) scale(1.06); }
}


/* ============================================================
   AUTH WRAPPER & CARD
============================================================ */
.auth-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 880px;
  background: var(--bg2);
  border: 1px solid rgba(255, 107, 26, .14);
  border-radius: 24px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, .6),
    0 0 60px rgba(255, 107, 26, .07);
  min-height: 580px;
}

/* Wider card for sign-up (more fields) */
.auth-card-wide {
  max-width: 960px;
}


/* ============================================================
   LEFT PANEL
============================================================ */
.auth-left {
  background: linear-gradient(160deg, #1e1208 0%, #140d06 60%, #0f0a05 100%);
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  border-right: 1px solid rgba(255, 107, 26, .10);
  overflow: hidden;
}

/* Decorative fire orbs inside left panel */
.auth-left::before {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle,
    rgba(255, 107, 26, .10) 0%, transparent 70%);
  pointer-events: none;
}

.auth-left::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle,
    rgba(255, 45, 45, .08) 0%, transparent 70%);
  pointer-events: none;
}

/* Brand row */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
  text-decoration: none;
}

.auth-brand-icon {
  width: 42px; height: 42px;
  background: var(--fire);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 18px rgba(255, 107, 26, .4);
}

.auth-brand-icon img {
  width: 24px; height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.auth-brand-icon i { color: #fff; font-size: .9rem; }

/* Tagline */
.auth-tagline {
  position: relative;
  z-index: 1;
}

.auth-tagline h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 12px;
}

.auth-tagline p {
  font-size: .83rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 280px;
}

/* Feature list */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
  flex: 1;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .82rem;
  color: var(--muted);
  transition: color .2s;
}

.auth-features li:hover { color: var(--text); }

.auth-feat-icon {
  width: 36px; height: 36px;
  background: rgba(255, 107, 26, .10);
  border: 1px solid rgba(255, 107, 26, .20);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: .8rem;
  color: var(--orange);
  flex-shrink: 0;
  transition: var(--t-sp);
}

.auth-features li:hover .auth-feat-icon {
  background: rgba(255, 107, 26, .18);
  box-shadow: 0 0 12px rgba(255, 107, 26, .25);
  transform: scale(1.1);
}

/* Back link */
.auth-left-footer {
  position: relative;
  z-index: 1;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .25s, gap .25s;
}

.auth-back-link:hover {
  color: var(--orange);
  gap: 12px;
}


/* ============================================================
   RIGHT PANEL
============================================================ */
.auth-right {
  padding: 44px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  background: var(--bg2);
  overflow-y: auto;
}

.auth-form-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: .84rem;
  color: var(--muted);
}

.auth-sub a {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}

.auth-sub a:hover { color: var(--yellow); }


/* ============================================================
   FORM LAYOUT
============================================================ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Two-column row (used on signup for username + display name) */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group label {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-optional {
  font-size: .72rem;
  font-weight: 400;
  color: var(--muted);
}

.form-forgot {
  font-size: .78rem;
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}

.form-forgot:hover { color: var(--yellow); }


/* ============================================================
   INPUT WRAPPER
   Key rule: position:relative + overflow:hidden so the
   toggle-pass button stays perfectly inside the border.
============================================================ */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
  overflow: hidden;         /* clips the toggle button to the border */
}

.input-wrap:focus-within {
  border-color: var(--orange);
  background: rgba(255, 107, 26, .04);
  box-shadow: 0 0 0 3px rgba(255, 107, 26, .14);
}

.input-wrap.input-error {
  border-color: var(--error);
  background: rgba(255, 77, 77, .04);
}

/* Left icon — always inside input-wrap */
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: .82rem;
  pointer-events: none;
  z-index: 1;
  transition: color .25s;
  flex-shrink: 0;
}

.input-wrap:focus-within .input-icon { color: var(--orange); }

/* The actual input field */
.input-wrap input {
  flex: 1;
  min-width: 0;               /* prevents overflow in flex */
  background: none;
  border: none;
  outline: none;
  padding: 13px 44px 13px 40px; /* left=icon, right=toggle btn */
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: .875rem;
}

/* When no toggle button exists, remove right padding */
.input-wrap:not(:has(.toggle-pass)) input {
  padding-right: 14px;
}

.input-wrap input::placeholder { color: var(--muted); opacity: .55; }

/* ── PASSWORD EYE TOGGLE ──────────────────────────────────────
   CRITICAL FIX:
   • position: absolute  →  relative to .input-wrap
   • right: 0, top: 0    →  flush with the right border edge
   • height: 100%        →  same height as the wrapper
   • overflow:hidden on .input-wrap clips it neatly inside
   This keeps the icon INSIDE the box at all times.
──────────────────────────────────────────────────────────── */
.toggle-pass {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 44px;
  background: none;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, .07);
  color: var(--muted);
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: color .2s ease, background .2s ease;
  flex-shrink: 0;
}

.toggle-pass:hover {
  color: var(--orange);
  background: rgba(255, 107, 26, .08);
}

/* Error text under field */
.error-msg {
  font-size: .73rem;
  color: var(--error);
  min-height: 16px;
  display: block;
  padding-left: 2px;
  transition: opacity .2s;
}


/* ============================================================
   PASSWORD STRENGTH METER
============================================================ */
.strength-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, .08);
  border-radius: 4px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width .4s ease, background .4s ease;
}

.strength-label {
  font-size: .7rem;
  font-weight: 600;
  min-width: 72px;
  text-align: right;
  transition: color .3s;
}


/* ============================================================
   CUSTOM CHECKBOX (Remember me / Terms agree)
============================================================ */
.remember-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

/* Hide native checkbox visually but keep it accessible */
.remember-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}

/* The visible box */
.custom-checkbox {
  width: 20px; height: 20px;
  border: 2px solid rgba(255, 255, 255, .18);
  border-radius: 5px;
  background: rgba(255, 255, 255, .04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;  /* align with first line of label text */
  transition:
    border-color .2s ease,
    background   .2s ease,
    box-shadow   .2s ease;
}

.custom-checkbox i {
  font-size: .65rem;
  color: #fff;
  opacity: 0;
  transform: scale(0) rotate(-10deg);
  transition:
    opacity   .2s ease,
    transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

/* Checked state — JS adds .checked to .remember-row */
.remember-row.checked .custom-checkbox {
  background: var(--fire);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(255, 107, 26, .4);
}

.remember-row.checked .custom-checkbox i {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.remember-row:hover .custom-checkbox {
  border-color: rgba(255, 107, 26, .5);
}

.remember-label {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
  transition: color .2s;
}

.remember-row:hover .remember-label { color: var(--text); }

.terms-link {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}

.terms-link:hover { color: var(--yellow); text-decoration: underline; }


/* ============================================================
   SUBMIT BUTTON
============================================================ */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--fire);
  color: #fff;
  border: none;
  border-radius: var(--r-xl);
  font-family: 'Poppins', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;
  position: relative;
  overflow: hidden;
}

.btn-auth::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle, rgba(255, 255, 255, .25) 0%, transparent 70%
  );
  transform: scale(0);
  opacity: 0;
  transition: transform .5s ease, opacity .5s ease;
}

.btn-auth:active::after {
  transform: scale(2.5);
  opacity: 1;
  transition: transform .15s ease, opacity .15s ease;
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 107, 26, .45);
  filter: brightness(1.08);
}

.btn-auth:active { transform: translateY(0) scale(.98); }

.btn-auth:disabled {
  opacity: .65;
  pointer-events: none;
}


/* ============================================================
   DIVIDER
============================================================ */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: .78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .08);
}


/* ============================================================
   SOCIAL BUTTONS
============================================================ */
.social-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--r-md);
  font-family: 'Poppins', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .3s ease;
}

.btn-social:hover {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 107, 26, .3);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}

.btn-social i { font-size: .9rem; }
.btn-social-google  i { color: #ea4335; }
.btn-social-discord i { color: #5865f2; }


/* ============================================================
   FORM FEEDBACK
============================================================ */
.form-feedback {
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: .82rem;
  font-weight: 500;
  text-align: center;
  display: none;
  animation: fade-in .3s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-feedback.success {
  display: block;
  background: rgba(74, 222, 128, .1);
  border: 1px solid rgba(74, 222, 128, .3);
  color: var(--success);
}

.form-feedback.error {
  display: block;
  background: rgba(255, 77, 77, .1);
  border: 1px solid rgba(255, 77, 77, .3);
  color: var(--error);
}


/* ============================================================
   RESPONSIVE
============================================================ */

/* Tablet — stack panels */
@media (max-width: 720px) {
  .auth-card,
  .auth-card-wide {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-left { display: none; }

  .auth-right {
    padding: 36px 28px;
    justify-content: flex-start;
  }
}

/* Mobile */
@media (max-width: 480px) {
  body { padding: 16px; }

  .auth-right { padding: 28px 20px; }

  .form-row-2 { grid-template-columns: 1fr; }

  .social-auth { grid-template-columns: 1fr; }

  .auth-form-header h1 { font-size: 1.55rem; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:  0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}