*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root,
[data-theme="dark"] {
  --bg:       #0e1618;
  --card:     #12191b;
  --input-bg: #0b1214;
  --accent:   #c9974f;
  --accent-d: #a9762f;
  --accent-rgb: 201,151,79;
  --text:     #e9e7e1;
  --muted:    #7c9095;
  --border:   rgba(255,255,255,0.08);
  --red:      #ef4444;
  --green:    #22c55e;
  --badge-grad: linear-gradient(135deg, #34505a, #16232a);
  --shadow-accent: 0 6px 24px rgba(var(--accent-rgb),.3);
}

[data-theme="light"] {
  --bg:       #f8f6f0;
  --card:     #ffffff;
  --input-bg: #f6f2e9;
  --accent:   #b9803a;
  --accent-d: #8f6127;
  --accent-rgb: 185,128,58;
  --text:     #1c2b30;
  --muted:    #6c7f83;
  --border:   rgba(28,43,48,0.10);
  --red:      #dc2626;
  --green:    #16a34a;
  --badge-grad: linear-gradient(135deg, #2a3e44, #16232a);
  --shadow-accent: 0 6px 20px rgba(var(--accent-rgb),.24);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: background .2s, color .2s;
  position: relative;
}

.theme-toggle {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px;
  background: rgba(var(--accent-rgb),.1);
  border: 1px solid var(--border); border-radius: 9px;
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.theme-toggle:hover { background: rgba(var(--accent-rgb),.2); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.auth-wrap { width: 100%; max-width: 400px; }

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 38px 34px;
}

.auth-logo {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.auth-logo img { width: 56px; height: 56px; object-fit: contain; }

h1 { font-size: 21px; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 5px; }
.sub { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 26px; }

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.alert-error   { background:rgba(239,68,68,.1);  border:1px solid rgba(239,68,68,.25); color:#e17575; }
.alert-success { background:rgba(34,197,94,.1);  border:1px solid rgba(34,197,94,.25); color:#4ade80; }

.field { margin-bottom: 16px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

label {
  display: flex;
  justify-content: space-between;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
label a { color: var(--accent); font-size: 13px; text-decoration: none; }
label a:hover { text-decoration: underline; }

.input-wrap { position: relative; }

input[type=email],
input[type=password],
input[type=text] {
  width: 100%;
  padding: 11px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.input-wrap input { padding-right: 42px; }
input:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); }

.eye {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center;
  padding: 2px; opacity: .55;
  transition: opacity .2s;
}
.eye:hover { opacity: 1; }

.pwd-meter { height: 3px; border-radius: 2px; margin-top: 6px; background: var(--border); overflow: hidden; }
.pwd-meter-bar { height: 100%; border-radius: 2px; width: 0; transition: width .3s, background .3s; }

.btn {
  width: 100%; padding: 13px;
  background: var(--accent);
  border: none; border-radius: 10px;
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 6px;
  transition: background .2s, transform .1s;
}
.btn:hover  { background: var(--accent-d); }
.btn:active { transform: scale(.98); }

.footer-link { text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }
.footer-link a { color: var(--accent); text-decoration: none; }
.footer-link a:hover { text-decoration: underline; }

@media(max-width:440px) { .auth-card { padding: 28px 20px; } }
