/* ================================================================
   DEORIS — Login / Sign-Up  (matches landing page design system)
   ================================================================ */

/* ── Tokens (same as landing index.css) ─────────────────────── */
:root {
  --clr-primary:     #7C3041;
  --clr-primary-d:   #5C2230;
  --clr-primary-l:   #9B3D50;
  --clr-primary-bg:  #F9EEF1;
  --clr-gold:        #C9A84C;
  --clr-gold-d:      #A8872E;
  --clr-gold-l:      #F0D98A;
  --clr-gold-bg:     #FDF6E3;
  --clr-text:        #1E2530;
  --clr-muted:       #6B7A8D;
  --clr-border:      #E8ECF0;
  --clr-panel:       #FFFFFF;
  --clr-success:     #16A34A;
  --clr-danger:      #DC2626;
  --grad-primary:    linear-gradient(135deg, #7C3041 0%, #9B3D50 100%);
  --grad-primary-d:  linear-gradient(135deg, #5C2230 0%, #7C3041 100%);
  --grad-gold:       linear-gradient(135deg, #C9A84C 0%, #E8C96A 100%);
  --grad-hero:       linear-gradient(160deg, rgba(92,34,48,.92) 0%, rgba(124,48,65,.78) 55%, rgba(92,34,48,.88) 100%);
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-full: 999px;
  --sh-md:  0 4px 12px rgba(0,0,0,.08), 0 8px 28px rgba(0,0,0,.08);
  --sh-lg:  0 8px 24px rgba(0,0,0,.12), 0 20px 48px rgba(0,0,0,.12);
  --sh-xl:  0 16px 48px rgba(0,0,0,.18), 0 32px 64px rgba(0,0,0,.12);
  --font-head: 'Cinzel', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--clr-text);
  line-height: 1.6;
  min-height: 100vh;
  /* Fallback if background image is slow / blocked */
  background-color: var(--clr-primary-d);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Background (hero image + overlay, same as landing) ─────── */
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}
.auth-bg-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  transform: scale(1.04);
  animation: bgZoom 20s ease-in-out infinite alternate;
}
@keyframes bgZoom {
  from { transform: scale(1.04); }
  to   { transform: scale(1.1); }
}
.auth-bg-overlay {
  position: absolute; inset: 0;
  background: var(--grad-hero);
}
.auth-bg-particles {
  position: absolute; inset: 0; overflow: hidden;
}
.auth-bg-particles span {
  position: absolute; display: block;
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(201,168,76,.45);
  animation: particleFloat linear infinite;
}
.auth-bg-particles span:nth-child(1) { left:8%;  top:15%; animation-duration:9s;  animation-delay:0s;   width:4px; height:4px; }
.auth-bg-particles span:nth-child(2) { left:20%; top:65%; animation-duration:12s; animation-delay:1s; }
.auth-bg-particles span:nth-child(3) { left:55%; top:30%; animation-duration:8s;  animation-delay:2s;   width:2px; height:2px; }
.auth-bg-particles span:nth-child(4) { left:70%; top:70%; animation-duration:14s; animation-delay:.5s; }
.auth-bg-particles span:nth-child(5) { left:85%; top:20%; animation-duration:10s; animation-delay:3s;   width:5px; height:5px; }
.auth-bg-particles span:nth-child(6) { left:40%; top:80%; animation-duration:11s; animation-delay:1.5s; }
@keyframes particleFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: .5; }
  100% { transform: translateY(-70px) rotate(360deg); opacity: 0; }
}

/* ── Back link ───────────────────────────────────────────────── */
.auth-back-link {
  position: fixed; top: 1.25rem; left: 1.5rem; z-index: 10;
  display: inline-flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.75); font-size: .82rem; font-weight: 600;
  padding: .45rem 1rem; border-radius: var(--r-full);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(8px); text-decoration: none;
  transition: background .2s, color .2s;
}
.auth-back-link:hover { background: rgba(255,255,255,.18); color: #fff; }
.auth-back-link i { font-size: .8rem; }

/* ── Page layout ─────────────────────────────────────────────── */
.auth-page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 5rem 1.25rem 2.5rem;
}

/* ── Card ────────────────────────────────────────────────────── */
.auth-card {
  width: 100%; max-width: 480px;
  background: rgba(255,255,255,.97);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  padding: 2.5rem 2.25rem;
  border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(16px);
  animation: cardIn .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Brand ───────────────────────────────────────────────────── */
.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}
.brand__badge {
  width: 80px; height: 80px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--clr-gold);
  box-shadow: 0 6px 20px rgba(201,168,76,.3);
}
.brand__badge img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.brand h1 {
  font-family: var(--font-head);
  font-size: 1.75rem; font-weight: 900;
  color: var(--clr-primary); letter-spacing: .08em;
  margin-bottom: .25rem;
}
.brand p {
  font-size: .8rem; color: var(--clr-muted); font-weight: 500;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; padding: 5px;
  background: var(--clr-border);
  border-radius: var(--r-md);
  margin-bottom: 1.75rem;
}
.tab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; border-radius: var(--r-sm);
  height: 40px; font-size: .875rem; font-weight: 600;
  cursor: pointer; background: transparent; color: var(--clr-muted);
  font-family: var(--font-body);
  transition: background .2s, color .2s, box-shadow .2s;
}
.tab-btn i { font-size: .8rem; }
.tab-btn:hover { background: rgba(124,48,65,.08); color: var(--clr-primary); }
.tab-btn.is-active {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 3px 10px rgba(124,48,65,.3);
}

/* ── Alerts ──────────────────────────────────────────────────── */
.form-alert {
  display: flex; align-items: flex-start; gap: .6rem;
  border: 1px solid rgba(220,38,38,.25);
  border-left: 3px solid var(--clr-danger);
  border-radius: var(--r-sm);
  background: #fef2f2;
  color: #991b1b;
  font-size: .82rem; line-height: 1.5;
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
}
.form-alert i { flex-shrink: 0; margin-top: .1rem; }
.form-alert ul { margin: 0; padding-left: 1rem; }
.form-alert--success {
  border-color: rgba(22,163,74,.25);
  border-left-color: var(--clr-success);
  background: #f0fdf4; color: #14532d;
}

/* ── Field groups ────────────────────────────────────────────── */
.field-group { margin-bottom: 1rem; }

.field-group label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 600;
  color: var(--clr-text); margin-bottom: .4rem;
}
.field-group label i { color: var(--clr-primary); font-size: .75rem; }

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="password"] {
  width: 100%; height: 44px;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-sm);
  background: #fafbfc;
  font-family: var(--font-body); font-size: .9rem;
  color: var(--clr-text); padding: 0 .9rem;
  outline: none;
  display: block;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field-group input::placeholder { color: var(--clr-muted); }
.field-group input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(124,48,65,.1);
  background: #fff;
}

/* Password toggle wrapper */
.input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.input-wrap input[type="text"],
.input-wrap input[type="password"] {
  width: 100%;
  padding-right: 2.75rem !important;
  margin-bottom: 0;
}
.toggle-pw {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-muted);
  font-size: .9rem;
  padding: .25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
  z-index: 2;
}
.toggle-pw:hover { color: var(--clr-primary); }

.field-help {
  font-size: .75rem; color: var(--clr-muted);
  margin-top: .35rem; line-height: 1.5;
}

/* ── Row between ─────────────────────────────────────────────── */
.row-between {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.remember {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; color: var(--clr-muted); cursor: pointer;
}
.remember input[type="checkbox"] { accent-color: var(--clr-primary); }
.terms-check {
  align-items: flex-start; line-height: 1.5; margin-bottom: 1.25rem;
}
.mini-link {
  font-size: .8rem; color: var(--clr-primary); font-weight: 600;
  text-decoration: none; transition: color .15s;
}
.mini-link:hover { color: var(--clr-primary-l); text-decoration: underline; }

/* ── Primary button ──────────────────────────────────────────── */
.primary-btn {
  width: 100%; height: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  border: none; border-radius: var(--r-sm);
  background: var(--grad-primary); color: #fff;
  font-family: var(--font-head); font-size: .9rem; font-weight: 700;
  letter-spacing: .04em; cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,48,65,.3);
  transition: box-shadow .2s, transform .2s;
  margin-bottom: 1rem;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,48,65,.45); }
.primary-btn:active { transform: translateY(0); }
.primary-btn i { font-size: .85rem; }

/* ── Switch footer ───────────────────────────────────────────── */
.switch-text {
  text-align: center; font-size: .82rem;
  color: var(--clr-muted); margin-top: .5rem;
}
.switch-btn {
  border: none; background: none;
  color: var(--clr-primary); font-size: .82rem; font-weight: 700;
  cursor: pointer; padding: 0; transition: color .15s;
}
.switch-btn:hover { color: var(--clr-primary-l); text-decoration: underline; }

/* ── Auth form visibility ────────────────────────────────────── */
.auth-form { display: none; }
.auth-form.is-visible { display: block; }

/* ── Misc (used by other auth views) ────────────────────────── */
.auth-message {
  margin: 0 0 1.25rem; color: var(--clr-muted);
  font-size: .875rem; line-height: 1.6; text-align: center;
}
.auth-actions {
  margin-top: .5rem; display: flex;
  justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.auth-actions form { margin: 0; }
.auth-card--message { max-width: 460px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  body {
    min-height: 100svh;
  }

  .auth-bg-img {
    background-position: center top;
  }

  .auth-bg-overlay {
    background:
      radial-gradient(circle at top left, rgba(240,217,138,.22), transparent 34%),
      linear-gradient(180deg, rgba(92,34,48,.94) 0%, rgba(124,48,65,.84) 48%, rgba(92,34,48,.96) 100%);
  }

  .auth-page {
    min-height: 100svh;
    align-items: flex-start;
    padding: 5.75rem clamp(1rem, 4vw, 1.5rem) 2rem;
  }

  .auth-card {
    max-width: 540px;
    padding: clamp(1.75rem, 4vw, 2.25rem);
    border-radius: 22px;
  }

  .brand {
    margin-bottom: 1.35rem;
  }

  .brand__badge {
    width: 72px;
    height: 72px;
    margin-bottom: .85rem;
  }

  .auth-tabs {
    margin-bottom: 1.35rem;
  }

  .field-group {
    margin-bottom: .9rem;
  }
}

@media (max-width: 640px) {
  html,
  body {
    height: auto;
  }

  body {
    overflow-y: auto;
  }

  .auth-back-link {
    top: max(.85rem, env(safe-area-inset-top));
    left: max(.85rem, env(safe-area-inset-left));
    padding: .5rem .8rem;
    color: #fff;
    background: rgba(255,255,255,.14);
  }

  .auth-page {
    width: 100%;
    padding:
      calc(4.4rem + env(safe-area-inset-top))
      max(.85rem, env(safe-area-inset-right))
      max(1.1rem, env(safe-area-inset-bottom))
      max(.85rem, env(safe-area-inset-left));
  }

  .auth-card {
    max-width: none;
    min-height: auto;
    padding: 1.35rem;
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(0,0,0,.24);
  }

  .brand {
    margin-bottom: 1rem;
  }

  .brand__badge {
    width: 62px;
    height: 62px;
    border-width: 2px;
  }

  .brand h1 {
    font-size: clamp(1.28rem, 6vw, 1.55rem);
    letter-spacing: .06em;
  }

  .brand p {
    max-width: 18rem;
    margin-inline: auto;
    font-size: .76rem;
    line-height: 1.35;
  }

  .auth-tabs {
    gap: 5px;
    padding: 4px;
    margin-bottom: 1.1rem;
  }

  .tab-btn {
    height: 42px;
    min-width: 0;
    font-size: .82rem;
  }

  .form-alert {
    padding: .7rem .8rem;
    font-size: .78rem;
  }

  .field-group label {
    font-size: .78rem;
  }

  .field-group input[type="text"],
  .field-group input[type="email"],
  .field-group input[type="password"] {
    height: 46px;
    font-size: 16px; /* prevents iOS zoom on focus */
    padding-inline: .85rem;
  }

  .input-wrap input[type="text"],
  .input-wrap input[type="password"] {
    padding-right: 3rem !important;
  }

  .toggle-pw {
    right: .65rem;
    width: 34px;
    height: 34px;
  }

  .row-between {
    gap: .75rem;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .remember,
  .mini-link,
  .switch-text,
  .switch-btn {
    font-size: .8rem;
  }

  .terms-check {
    align-items: flex-start;
  }

  .primary-btn {
    height: 48px;
    margin-bottom: .85rem;
    font-size: .86rem;
  }
}

@media (max-width: 420px) {
  .auth-back-link {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
  }

  .auth-back-link {
    font-size: 0;
  }

  .auth-back-link i {
    font-size: .9rem;
  }

  .auth-card {
    padding: 1.1rem;
    border-radius: 18px;
  }

  .brand__badge {
    width: 56px;
    height: 56px;
    margin-bottom: .7rem;
  }

  .auth-tabs {
    position: sticky;
    top: .6rem;
    z-index: 3;
    box-shadow: 0 8px 20px rgba(30,37,48,.08);
  }

  .tab-btn {
    gap: .3rem;
  }

  .tab-btn i {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-bg-img { animation: none; }
  .auth-bg-particles { display: none; }
  .auth-card { animation: none; }
}
