:root {
  --green: #084420;
  --green-2: #0b5c2f;
  --green-deep: #04250f;
  --gold: #c9a96e;
  --gold-light: #e2c992;
  --gold-dark: #a8874f;
  --cream: #f7f5f0;
  --cream-2: #efebe2;
  --charcoal: #1d1d1d;
  --charcoal-2: #6b665c;
  --white: #ffffff;
  --red: #c0392b;
  --shadow: 0 30px 70px -24px rgba(4, 26, 12, 0.45);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--green-deep);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input { font-family: inherit; font-size: 1rem; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 28px 18px;
  background:
    radial-gradient(1000px 560px at 82% -6%, rgba(201, 169, 110, 0.22), transparent 62%),
    radial-gradient(820px 560px at 8% 108%, rgba(11, 92, 47, 0.5), transparent 58%),
    linear-gradient(160deg, #0a3d1f 0%, #04250f 55%, #03170a 100%);
}

.login-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 169, 110, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 169, 110, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 22%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 42%, #000 22%, transparent 74%);
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(412px, 100%);
  background: var(--white);
  border-radius: 28px;
  padding: 40px 38px 34px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201, 169, 110, 0.5);
  animation: cardIn .5s cubic-bezier(.2,.8,.3,1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand img {
  width: 76px; height: 76px;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 8px rgba(201, 169, 110, 0.16);
  object-fit: cover;
}
.brand-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.34em; color: var(--gold-dark); }
.login-brand h1 { font-family: var(--font-display); font-size: 2rem; color: var(--green); letter-spacing: 0.03em; margin-top: 4px; }
.login-brand h1 .gold { color: var(--gold-dark); }
.brand-sub { color: var(--charcoal-2); font-size: 0.86rem; margin-top: 6px; }

.login-msg {
  background: rgba(201, 169, 110, 0.16);
  border: 1px solid rgba(201, 169, 110, 0.5);
  color: var(--green-deep);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.login-msg.err { background: rgba(192, 57, 43, 0.1); border-color: rgba(192, 57, 43, 0.35); color: var(--red); }
.login-msg.ok { background: rgba(8, 68, 32, 0.08); border-color: rgba(8, 68, 32, 0.3); color: var(--green); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--charcoal-2); margin-bottom: 7px; letter-spacing: 0.02em; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg { width: 18px; height: 18px; color: var(--gold-dark); position: absolute; left: 14px; pointer-events: none; }
.input-wrap input {
  width: 100%;
  background: var(--white);
  border: 1.5px solid #e0dacd;
  border-radius: 13px;
  padding: 14px 46px;
  color: var(--charcoal);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input-wrap input::placeholder { color: #b6b0a2; }
.input-wrap input:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 4px rgba(201, 169, 110, 0.2); }
.reveal-btn {
  position: absolute; right: 9px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--charcoal-2);
}
.reveal-btn:hover { background: var(--cream-2); color: var(--green); }
.reveal-btn svg { width: 19px; height: 19px; position: static; }

.form-error {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.35);
  color: var(--red);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 0.87rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 22px;
  border-radius: 13px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--white);
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 14px 28px -12px rgba(8, 68, 32, 0.55);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 18px 34px -12px rgba(8, 68, 32, 0.6); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.6; pointer-events: none; }
.btn .btn-arrow { width: 18px; height: 18px; transition: transform .2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn.loading .btn-arrow { display: none; }
.btn.loading .btn-label::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 10px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.76rem;
  color: var(--charcoal-2);
  font-weight: 600;
}
.lock-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2e9e5b;
  box-shadow: 0 0 0 3px rgba(46, 158, 91, 0.18);
}

.login-card.shake { animation: shake .4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-9px)} 40%,80%{transform:translateX(9px)} }

@media (max-width: 480px) {
  .login-card { padding: 32px 24px 28px; }
}
