:root {
  --ink: #080705;
  --ink-soft: #120e0b;
  --card-bg: rgba(14, 11, 8, 0.82);
  --gold: #d4b15a;
  --gold-light: #f5e4b8;
  --gold-deep: #8a6f3d;
  --bronze: #c4a46a;
  --sand: #e0d2bd;
  --muted: #9e917d;
  --line: rgba(212, 177, 90, 0.24);
  --line-strong: rgba(212, 177, 90, 0.48);
  --err: #e05252;
  --ok: #34d399;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  color: var(--sand);
  font-family: "Cormorant Garamond", Georgia, serif;
  background:
    linear-gradient(180deg, rgba(8, 7, 5, 0.45) 0%, rgba(8, 7, 5, 0.72) 45%, rgba(8, 7, 5, 0.92) 100%),
    url("/bg-login.jpg?v=1") center 30% / cover no-repeat fixed #080705;
}

.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 25%, rgba(212, 177, 90, 0.08) 0%, transparent 60%);
}

.gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px 56px;
}

.crest-wrap {
  position: relative;
  margin-bottom: 16px;
}

.crest {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(212, 177, 90, 0.3), 0 14px 34px rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(212, 177, 90, 0.45);
  display: block;
}

.kicker {
  font-family: "Cinzel", serif;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 11px;
  margin: 0 0 6px;
  text-align: center;
}

h1 {
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: clamp(26px, 5.5vw, 38px);
  margin: 0 0 4px;
  color: #f7edd4;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.subtitle {
  margin: 0 0 22px;
  text-align: center;
  font-size: 17px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.card {
  width: min(480px, 100%);
  padding: 28px 24px 26px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 30px rgba(212, 177, 90, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease-out;
}

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

.hidden {
  display: none !important;
}

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

.card-header {
  margin-bottom: 4px;
}

.card-header h2 {
  font-family: "Cinzel", serif;
  font-size: 20px;
  color: var(--gold-light);
  margin: 6px 0 4px;
  letter-spacing: 0.08em;
}

.card-header .hint, p.hint {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* Spinner */
.spinner {
  width: 36px;
  height: 36px;
  margin: 18px auto;
  border: 3px solid rgba(212, 177, 90, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.check-text {
  text-align: center;
  font-size: 18px;
  color: var(--sand);
  margin: 0;
}

/* Badges */
.shield-badge {
  display: inline-block;
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  padding: 3px 10px;
  background: rgba(212, 177, 90, 0.12);
  border: 1px solid rgba(212, 177, 90, 0.35);
  color: var(--gold);
  border-radius: 20px;
  text-transform: uppercase;
}

.shield-badge.success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

/* Banner de Convite Ativo */
.invite-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(212, 177, 90, 0.08);
  border: 1px dashed rgba(212, 177, 90, 0.35);
  border-radius: 6px;
}

.invite-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Cinzel", serif;
  font-size: 11px;
  color: #34d399;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.invite-tag .dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #34d399;
}

.invite-code-display {
  font-family: "Inter", monospace, sans-serif;
  font-size: 12px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Inputs & Labels */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

label {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

label .req {
  color: var(--gold);
}

input[type="text"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.85);
  color: #f7edd4;
  font: 17px "Inter", sans-serif;
  border-radius: 5px;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 177, 90, 0.25);
  background: rgba(16, 12, 9, 0.95);
}

input::placeholder {
  color: rgba(158, 145, 125, 0.45);
  font-size: 15px;
}

.field-tip {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}

/* Input com Ação */
.input-with-action {
  display: flex;
  gap: 8px;
}

.input-with-action input {
  flex: 1;
}

/* Divisão / OND Pickers */
.division-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.div-pill input {
  display: none;
}

.div-box {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(15, 12, 9, 0.7);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.div-pill input:checked + .div-box {
  border-color: var(--gold);
  background: rgba(212, 177, 90, 0.14);
  box-shadow: 0 0 12px rgba(212, 177, 90, 0.2);
}

.div-name {
  font-family: "Cinzel", serif;
  font-size: 14px;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}

.div-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* WhatsApp Input Wrap */
.whats-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(10, 8, 6, 0.85);
  overflow: hidden;
}

.whats-flag {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  padding: 11px 12px;
  background: rgba(212, 177, 90, 0.08);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.whats-input-wrap input {
  border: none;
  background: transparent;
  flex: 1;
}

.whats-input-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 177, 90, 0.25);
}

/* Password Toggle */
.pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-toggle-pass {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 4px;
  opacity: 0.7;
}

.btn-toggle-pass:hover {
  opacity: 1;
}

/* Password Meter */
.pass-meter {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.meter-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.meter-weak { width: 33%; background: #ef4444; }
.meter-med { width: 66%; background: #f59e0b; }
.meter-strong { width: 100%; background: #10b981; }

/* Security Banner */
.security-banner {
  padding: 12px 14px;
  background: rgba(212, 177, 90, 0.06);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  margin: 10px 0 14px;
}

.sec-title {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.security-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--sand);
  line-height: 1.4;
}

.security-box {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 177, 90, 0.15);
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.security-box.highlight {
  background: rgba(212, 177, 90, 0.08);
  border-color: rgba(212, 177, 90, 0.3);
  color: var(--sand);
}

.sec-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* Erros */
.err {
  color: #ff6b6b;
  font-size: 14px;
  margin: 4px 0 10px;
  min-height: 18px;
  font-family: "Inter", sans-serif;
  line-height: 1.3;
}

/* Botões */
.btn-gold, .btn-submit {
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 13px 20px;
  background: linear-gradient(135deg, #e5c378 0%, #c4a46a 50%, #997b44 100%);
  color: #120e0b;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(212, 177, 90, 0.3);
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-gold:hover, .btn-submit:hover {
  background: linear-gradient(135deg, #f0d48f 0%, #d4b15a 50%, #a8884c 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(212, 177, 90, 0.45);
}

.btn-submit {
  width: 100%;
  font-size: 13px;
  padding: 14px 20px;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(18, 14, 11, 0.3);
  border-top-color: #120e0b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* Tela de Sucesso */
.success-stack {
  text-align: center;
  align-items: center;
  padding: 10px 0;
}

.shield-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  border: 2px solid #34d399;
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
}

.success-msg {
  font-size: 18px;
  color: var(--sand);
  margin: 0 0 10px;
  line-height: 1.4;
}

.summary-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  text-align: left;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 15px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row span {
  color: var(--muted);
}

.summary-row strong {
  color: var(--gold-light);
  font-family: "Inter", sans-serif;
}

.badge-pending {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 3px 8px;
  border-radius: 4px;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.back-link {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--sand);
}

/* Rodapé */
.footer-links {
  margin-top: 24px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-links a {
  color: var(--bronze);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--gold-light);
}

.footer-links .sep {
  color: var(--muted);
  opacity: 0.5;
}
