@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Nunito:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:           #faf7f2;
  --panel:        #ffffff;
  --border:       #e8ddd0;
  --text:         #2c1f0e;
  --muted:        #9b7e63;
  --accent:       #8b5e3c;
  --accent2:      #a0714f;
  --accent-light: #f5ebe0;
  --accent-glow:  rgba(139,94,60,0.12);
  --danger:       #c0392b;
}

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

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow: hidden;
}

/* Warm decorative circles */
body::before {
  content: '';
  position: fixed;
  top: -120px; right: -80px;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,94,60,0.08), transparent 70%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px; left: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160,113,79,0.07), transparent 70%);
  pointer-events: none;
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  animation: riseUp 0.5s ease;
}

@keyframes riseUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Top branding */
.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand .logo {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(139,94,60,0.2));
}

.login-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.login-brand p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
  font-weight: 500;
}

/* Card */
.login-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow:
    0 4px 24px rgba(139,94,60,0.08),
    0 1px 0 rgba(255,255,255,0.8) inset;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.field-group input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #faf7f2;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: white;
}

.field-group input::placeholder { color: var(--muted); opacity: 0.6; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }

.toggle-pw {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 16px;
  opacity: 0.5; transition: opacity 0.15s;
  padding: 4px; color: var(--muted);
}

.toggle-pw:hover { opacity: 1; }

.login-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 700;
  min-height: 18px;
  text-align: center;
  padding: 2px 0;
}

.login-btn {
  width: 100%; padding: 15px;
  border-radius: 14px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 16px; font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(139,94,60,0.3);
  letter-spacing: 0.3px;
}

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(139,94,60,0.35); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-hint {
  font-size: 13px; color: var(--muted);
  margin-top: 16px; text-align: center; font-weight: 600;
}

.login-hint a {
  color: var(--accent); text-decoration: none; font-weight: 800;
  transition: opacity 0.15s;
}

.login-hint a:hover { opacity: 0.8; text-decoration: underline; }

/* Decorative bottom text */
.login-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}