/* ══════════════════════════════════════════════════════════════
   TicketYar — Auth Pages (Modern Premium)
   ══════════════════════════════════════════════════════════════ */

:root {
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-tint: #EFF6FF;
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-inset: #F9FAFB;
  --text: #111827;
  --text-sec: #4B5563;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --success: #059669;
  --brand-ink: var(--brand);
  --brand-solid: var(--brand);
  --error: #DC2626;
  --error-bg: #FEF2F2;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --font: 'IRANSansXFaNum', 'Segoe UI', system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-inset: #1A2332;
  --text: #F1F5F9;
  --text-sec: #94A3B8;
  --border: #334155;
  --border-strong: #475569;
  --brand-tint: rgba(37,99,235,0.12);
  --brand-ink: var(--brand);
  --error-bg: rgba(220,38,38,0.1);
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 28px; font-size: 14.5px; line-height: 1.5;
}
::selection { background: var(--brand-solid); color: #fff; }

/* ── Layout ── */
.auth-layout {
  width: 100%; max-width: 880px;
  display: grid; grid-template-columns: 1fr 1.1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ── Brand Panel ── */
.auth-brand {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  color: #F1F5F9;
  padding: 48px 40px;
  display: flex; flex-direction: column;
  justify-content: center;
  border-left: 1px solid #334155;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(37,99,235,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.auth-brand .brand-logo {
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
  position: relative; z-index: 1;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}
.auth-brand .brand-logo img {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 12px;
}
.auth-brand h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; position: relative; z-index: 1; }
.auth-brand p { font-size: 14px; color: #94A3B8; line-height: 1.7; max-width: 280px; position: relative; z-index: 1; }
.auth-brand .features { margin-top: 32px; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.auth-brand .feature-item { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #CBD5E1; }
.auth-brand .feature-item i {
  width: 28px; height: 28px;
  background: rgba(37,99,235,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; color: #60A5FA;
}

/* ── Form Side ── */
.auth-form-side {
  padding: 44px 40px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-form-side h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-form-side .subtitle { font-size: 14px; color: var(--text-sec); margin-bottom: 28px; }

/* Messages */
.auth-msg {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.auth-msg.error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(220,38,38,0.15); }
.auth-msg.success { background: #ECFDF5; color: var(--success); border: 1px solid rgba(5,150,105,0.15); }

/* ── Fields ── */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 700;
  margin-bottom: 6px; color: var(--text);
}
.field .input-box {
  position: relative; display: flex; align-items: center;
  background: var(--surface-inset); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.field .input-box:hover { border-color: var(--border-strong); }
.field .input-box:focus-within { border-color: var(--brand-ink); background: var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.field .input-box.has-error { border-color: var(--error); }
.field .input-box.has-error:focus-within { box-shadow: 0 0 0 3px rgba(220,38,38,0.1); }
.field .input-box i.field-icon {
  position: absolute; right: 12px;
  color: var(--text-sec); font-size: 14px;
  pointer-events: none; transition: color .2s;
}
.field .input-box:focus-within i.field-icon { color: var(--brand-ink); }
.field .input-box input,
.field .input-box select {
  width: 100%; padding: 11px 38px 11px 12px;
  border: none; background: transparent;
  font-family: var(--font); font-size: 14.5px;
  color: var(--text); outline: none;
}
.field .input-box input::placeholder { color: var(--text-sec); font-size: 13.5px; }
.field .input-box select { cursor: pointer; appearance: none; }
.field .field-error {
  font-size: 12.5px; color: var(--error);
  margin-top: 5px; display: flex; align-items: center; gap: 4px;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Submit Button ── */
.btn-submit {
  width: 100%; padding: 12px;
  border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand) 0%, #1D4ED8 100%);
  color: #fff;
  font-family: var(--font); font-size: 14.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }
.btn-submit i { font-size: 14px; }

/* ── Footer ── */
.auth-footer {
  text-align: center; margin-top: 24px;
  font-size: 13.5px; color: var(--text-sec);
}
.auth-footer a { color: var(--brand-ink); font-weight: 700; text-decoration: none; transition: color .2s; }
.auth-footer a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ── Theme Toggle ── */
.theme-btn {
  position: fixed; top: 16px; left: 16px; z-index: 50;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-sec); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: all .2s;
}
.theme-btn:hover { color: var(--brand-ink); border-color: var(--brand-ink); transform: scale(1.05); }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 20px; left: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-right: 4px solid var(--success); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  width: 300px; max-width: 90vw; animation: slideIn .25s ease;
}
.toast.error { border-right-color: var(--error); }
.toast i.t-ico { font-size: 16px; color: var(--success); margin-top: 2px; }
.toast.error i.t-ico { color: var(--error); }
.toast b { font-size: 13px; display: block; margin-bottom: 2px; }
.toast p { font-size: 12px; color: var(--text-sec); }
.toast .t-close {
  margin-right: auto; background: none; border: none;
  color: var(--text-sec); font-size: 12px; cursor: pointer; padding: 2px 4px;
  transition: color .15s;
}
.toast .t-close:hover { color: var(--error); }
@keyframes slideIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

.fa-spin { animation: fa-spin 1s infinite linear; }
@keyframes fa-spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }

/* ── Responsive ── */
@media(max-width:768px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 440px; }
  .auth-brand {
    padding: 32px 28px; border-left: none;
    border-bottom: 1px solid #334155;
    border-radius: 12px 12px 0 0;
  }
  .auth-brand .features { display: none; }
  .auth-form-side { padding: 28px 24px; }
  .field-row { grid-template-columns: 1fr; }
}
@media(max-width:480px) {
  body { padding: 12px; }
  .auth-brand { padding: 24px 20px; }
  .auth-brand h2 { font-size: 18px; }
  .auth-form-side { padding: 24px 20px; }
  .auth-form-side h1 { font-size: 18px; }
}
