/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #2C1A0E;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input  { font-family: inherit; font-size: inherit; }

/* ===========================
   TOKENS
   =========================== */
:root {
  --accent:     #B8722A;
  --accent-lt:  #CE8A42;
  --accent-bg:  #FEF0DC;
  --cream:      #FDF5E6;
  --cream-dark: #F5E8CC;
  --white:      #FFFFFF;
  --dark:       #2C1A0E;
  --dark-2:     #3D2314;
  --gray:       #7D6B56;
  --border:     #E8D5B0;
  --green:      #5A8A5E;
  --yellow:     #C8913A;
  --red:        #C0513A;
  --radius:     10px;
  --transition: 0.2s ease;
}

/* ===========================
   LAYOUT
   =========================== */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ===========================
   LEFT PANEL — brand
   =========================== */
.auth-brand {
  background: linear-gradient(155deg, #7A3D10 0%, #B8722A 55%, #CE8A42 100%);
  padding: 40px 48px 48px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* subtle dot grid overlay */
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(253,245,230,.12) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* radial glow bottom-right */
.auth-brand::after {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253,245,230,.15) 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
  pointer-events: none;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
  width: fit-content;
}
.brand-logo rect { fill: rgba(255,255,255,.22) !important; }

.brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.brand-headline {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 12px;
}

.brand-sub {
  font-size: 15px;
  color: rgba(253,245,230,.75);
  margin-bottom: 32px;
  max-width: 340px;
}

/* Mini mockup */
.brand-mockup {
  background: rgba(253,245,230,.12);
  border: 1px solid rgba(253,245,230,.22);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bm-card {
  background: rgba(253,245,230,.15);
  border-radius: 12px;
  padding: 14px 16px;
}
.bm-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(253,245,230,.6);
  margin-bottom: 4px;
}
.bm-card__name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.bm-card__reward { font-size: 12px; color: rgba(253,245,230,.7); }

.bm-stats { display: flex; gap: 10px; }
.bm-stat {
  flex: 1;
  background: rgba(253,245,230,.1);
  border-radius: 10px;
  padding: 10px 12px;
}
.bm-stat__val {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.bm-stat__lbl { font-size: 10px; color: rgba(253,245,230,.55); }

.bm-benefit { display: flex; align-items: center; gap: 10px; }
.bm-benefit__icon { font-size: 20px; flex-shrink: 0; }
.bm-benefit__info { flex: 1; }
.bm-benefit__name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 5px;
}
.bm-benefit__bar {
  height: 5px;
  background: rgba(253,245,230,.2);
  border-radius: 3px;
  overflow: hidden;
}
.bm-benefit__fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
}
.bm-benefit__val {
  font-size: 11px;
  font-weight: 600;
  color: rgba(253,245,230,.7);
  white-space: nowrap;
}

/* Feature list */
.brand-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}
.brand-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(253,245,230,.92);
}
.brand-features__icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(253,245,230,.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Social proof */
.brand-proof { display: flex; align-items: center; gap: 14px; }
.brand-proof__avatars { display: flex; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(253,245,230,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  margin-left: -8px;
}
.avatar:first-child { margin-left: 0; }

.brand-proof__text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: rgba(253,245,230,.7);
}
.brand-proof__stars {
  color: #FDF5E6;
  font-size: 11px;
  margin-bottom: 2px;
}

/* ===========================
   RIGHT PANEL — form
   =========================== */
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 32px;
  overflow-y: auto;
  min-height: 100vh;
  background: #fff;
}

.mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 32px;
  align-self: flex-start;
}
.mobile-logo rect { fill: var(--accent); }

.views {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  padding: 20px 0;
}

/* ===========================
   VIEWS
   =========================== */
.view { animation: fadeIn .25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ===========================
   GREETING
   =========================== */
.auth-greeting { margin-bottom: 28px; }

.auth-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}
.auth-subtitle { font-size: 15px; color: var(--gray); }

/* ===========================
   TABS
   =========================== */
.auth-tabs {
  display: flex;
  position: relative;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  border-radius: 9px;
  transition: color var(--transition);
  position: relative;
  z-index: 1;
}
.auth-tab--active { color: var(--dark); }

.auth-tab__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 1px 4px rgba(44,26,14,.1);
  transition: transform var(--transition);
  pointer-events: none;
}
.auth-tab__indicator.right { transform: translateX(calc(100% + 0px)); }

/* ===========================
   SOCIAL BUTTONS
   =========================== */
.social-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  background: #fff;
  transition: var(--transition);
}
.social-btn:hover {
  border-color: var(--accent);
  background: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(184,114,42,.12);
}
.social-btn:active { transform: none; }

/* ===========================
   DIVIDER
   =========================== */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: #A89078;
  font-size: 13px;
  font-weight: 500;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}

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

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #C4AA8A;
  pointer-events: none;
  flex-shrink: 0;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--dark);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input::placeholder { color: #C4AA8A; }

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,114,42,.14);
}

/* States */
.form-group.is-error .form-input {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,81,58,.1);
}
.form-group.is-success .form-input {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(90,138,94,.1);
}

.input-status {
  position: absolute;
  right: 44px;
  width: 18px;
  height: 18px;
  display: none;
}
.form-group.is-error .input-status,
.form-group.is-success .input-status { display: block; }

.form-group.is-success .input-status::after {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
}
.form-group.is-error .input-status::after {
  content: '✕';
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 4px;
}
.form-group.is-error .form-error { display: flex; }

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  color: #C4AA8A;
  transition: color var(--transition);
  padding: 4px;
}
.toggle-password:hover { color: var(--dark); }

/* ===========================
   PASSWORD STRENGTH
   =========================== */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.pw-strength.visible { opacity: 1; }

.pw-strength__bars {
  display: flex;
  gap: 4px;
  flex: 1;
}
.pw-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition);
}
.pw-bar.active-1 { background: var(--red); }
.pw-bar.active-2 { background: var(--yellow); }
.pw-bar.active-3 { background: #84a840; }
.pw-bar.active-4 { background: var(--green); }

.pw-strength__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  white-space: nowrap;
}

/* ===========================
   CHECKBOX
   =========================== */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: #fff;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.checkbox-input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-input:checked + .checkbox-box::after {
  content: '';
  display: block;
  width: 10px;
  height: 7px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.checkbox-text {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
}
.text-link:hover { text-decoration: underline; }

/* ===========================
   SUBMIT BUTTON
   =========================== */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}
.btn-submit:hover {
  background: var(--accent-lt);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(184,114,42,.35);
}
.btn-submit:active { transform: none; }
.btn-submit:disabled { opacity: .65; pointer-events: none; }

.btn-submit__spinner {
  display: none;
  animation: spin .7s linear infinite;
}
.btn-submit.loading .btn-submit__text,
.btn-submit.loading .btn-submit__arrow { display: none; }
.btn-submit.loading .btn-submit__spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================
   LINK BUTTONS
   =========================== */
.link-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  transition: color var(--transition);
}
.link-btn:hover { color: var(--dark); }
.link-btn--purple { color: var(--accent); }
.link-btn--purple:hover { color: var(--accent-lt); text-decoration: underline; }

/* ===========================
   AUTH SWITCH
   =========================== */
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--gray);
}

/* ===========================
   FORGOT PASSWORD VIEW
   =========================== */
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 28px;
  transition: color var(--transition);
}
.back-btn:hover { color: var(--dark); }

/* ===========================
   SUCCESS VIEW
   =========================== */
.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #E8F5E8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.success-icon svg { stroke: var(--green); }

/* ===========================
   FOOTER
   =========================== */
.auth-footer {
  font-size: 12px;
  color: #A89078;
  text-align: center;
  margin-top: auto;
  padding-top: 32px;
}
.auth-footer .text-link { color: #A89078; font-weight: 400; }
.auth-footer .text-link:hover { color: var(--gray); }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .mobile-logo { display: flex; }
  .auth-panel { padding: 32px 20px 24px; }
}

@media (max-width: 480px) {
  .views { padding: 0; }
  .auth-title { font-size: 22px; }
}
