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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #1A0C04 0%, #3D1E08 40%, #7A3D12 75%, #C8762A 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  overflow: auto;
  position: relative;
}

/* ── Background decorations ── */
.bg-decoration { position: fixed; inset: 0; pointer-events: none; }
.circle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.c1 { width: 500px; height: 500px; top: -150px; right: -100px; }
.c2 { width: 350px; height: 350px; bottom: -100px; left: -80px; }
.c3 { width: 200px; height: 200px; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(255,255,255,0.02); }

/* ── Card ── */
.login-wrapper { position: relative; z-index: 1; width: 100%; max-width: 400px; }

.login-card {
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 40px 36px 36px;
  box-shadow:
    0 25px 60px rgba(0,0,0,0.4),
    0 8px 20px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
}

/* Shake animation on wrong password */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  30%       { transform: translateX(7px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(5px); }
  75%       { transform: translateX(-3px); }
  90%       { transform: translateX(2px); }
}
.login-card.shake { animation: shake 0.45s cubic-bezier(.36,.07,.19,.97); }

/* ── Brand ── */
.brand { text-align: center; margin-bottom: 24px; }
.brand-icon {
  font-size: 48px; line-height: 1;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 38px; font-weight: 600;
  color: #7A4520; letter-spacing: -0.5px;
  margin-bottom: 4px; line-height: 1;
}
.brand-sub {
  font-size: 12px; font-weight: 500;
  color: #a1a1aa; letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e4e4e7, transparent);
  margin-bottom: 28px;
}

/* ── Form ── */
.field-label {
  display: block; font-size: 12px; font-weight: 700;
  color: #71717a; text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}

.input-wrap {
  position: relative; display: flex; align-items: center;
  margin-bottom: 14px;
}
.input-icon {
  position: absolute; left: 14px;
  font-size: 16px; line-height: 1; pointer-events: none;
}
.input-wrap input {
  width: 100%; padding: 14px 44px 14px 44px;
  border: 2px solid #e4e4e7; border-radius: 12px;
  font-size: 16px; font-family: inherit;
  color: #18181b; background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 2px;
}
.input-wrap input::placeholder { letter-spacing: 0.3px; color: #d4d4d8; }
.input-wrap input:focus {
  outline: none;
  border-color: #C8762A;
  background: white;
  box-shadow: 0 0 0 4px rgba(200,118,42,0.12);
}

.toggle-pw {
  position: absolute; right: 12px;
  background: none; border: none;
  font-size: 18px; cursor: pointer; padding: 4px;
  opacity: 0.5; transition: opacity 0.15s;
  line-height: 1;
}
.toggle-pw:hover { opacity: 0.9; }

/* ── Error ── */
.error-msg {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; font-weight: 500; color: #dc2626;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}
.error-msg::before { content: '⚠️'; font-size: 14px; }

/* ── Submit ── */
.submit-btn {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, #8B4A10 0%, #C8762A 100%);
  color: white; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer; letter-spacing: 0.3px;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(192,57,43,0.4);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.submit-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(200,118,42,0.5);
  transform: translateY(-1px);
}
.submit-btn:active:not(:disabled) { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.75; cursor: not-allowed; }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
