:root {
  --ink: #241A12;
  --umber: #3A2A1C;
  --gold: #C89A4B;
  --goldlt: #E4C583;
  --parch: #F3E9D6;
  --taupe: #B3A38C;
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Work Sans', sans-serif;
  background: var(--ink);
  color: var(--parch);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 15% 20%, rgba(200, 154, 75, 0.13) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 80%, rgba(138, 90, 59, 0.10) 0%, transparent 55%);
}

.grain-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/></svg>");
  mix-blend-mode: overlay;
}

.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(200, 154, 75, 0.3), transparent 70%);
  animation: float linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(110vh) translateX(0) scale(0.5);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% {
    transform: translateY(-20vh) translateX(var(--drift)) scale(1.2);
    opacity: 0;
  }
}

.login-card {
  position: relative;
  z-index: 10;
  width: calc(100% - 48px);
  max-width: 420px;
  margin: 24px;
  background: rgba(58, 42, 28, 0.60);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(200, 154, 75, 0.18);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.55);
  animation: cardIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(228, 197, 131, 0.5), transparent);
  border-radius: 50%;
}

.tau-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid rgba(200, 154, 75, 0.35);
  border-radius: 14px;
  margin: 0 auto 20px;
  background: rgba(200, 154, 75, 0.08);
}

.login-title {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--parch);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 6px;
}

.login-subtitle {
  text-align: center;
  font-size: 0.78rem;
  color: var(--taupe);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 154, 75, 0.25), transparent);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--taupe);
  pointer-events: none;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  background: rgba(36, 26, 18, 0.5);
  border: 1px solid rgba(200, 154, 75, 0.18);
  border-radius: 10px;
  color: var(--parch);
  padding: 13px 14px 13px 42px;
  font-size: 0.96rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus {
  outline: none;
  border-color: rgba(228, 197, 131, 0.5);
  box-shadow: 0 0 0 3px rgba(200, 154, 75, 0.12);
}

.password-toggle,
.toggle-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--taupe);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.btn-submit,
.btn-login {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--gold), #a57a3b);
  color: #fff;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 18px 26px -18px rgba(200, 154, 75, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover,
.btn-login:hover {
  transform: translateY(-1px);
}

.btn-submit:disabled,
.btn-login:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.button-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-box {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(200, 60, 60, 0.12);
  border: 1px solid rgba(200, 60, 60, 0.25);
  color: #f0b0aa;
  font-size: 0.8rem;
  line-height: 1.4;
}

.error-box.show {
  display: block;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

.card-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--taupe);
}

.card-footer a {
  color: var(--goldlt);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-footer a:hover {
  color: var(--parch);
}

.page-footer {
  position: relative;
  z-index: 5;
  margin-top: 20px;
  font-size: 0.72rem;
  color: rgba(243, 233, 214, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px;
    margin: 16px;
    width: calc(100% - 32px);
  }
}
