/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-from:   #0f0c29;
  --bg-to:     #1a1a2e;
  --card-bg:   rgba(255,255,255,0.05);
  --card-border: rgba(255,255,255,0.1);
  --accent:    #7c3aed;
  --accent-light: #a78bfa;
  --safe:      #10b981;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --text:      #e2e8f0;
  --text-muted:#94a3b8;
  --radius:    12px;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-from), var(--bg-to));
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  text-align: center;
  padding-top: 1rem;
}

.logo {
  font-size: 3rem;
  margin-bottom: .5rem;
  filter: drop-shadow(0 0 16px rgba(124,58,237,.6));
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(90deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin-top: .35rem;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Input ─────────────────────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.input-wrapper {
  position: relative;
}

input[type="password"],
input[type="text"] {
  width: 100%;
  padding: .75rem 3rem .75rem 1rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: .1em;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(167,139,250,.2);
}

.toggle-visibility {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: .6;
  transition: opacity .2s;
  padding: 0;
  line-height: 1;
}
.toggle-visibility:hover { opacity: 1; }

/* ── Barra de força ────────────────────────────────────────────────────────── */
.strength-bar-container {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width .35s ease, background-color .35s ease;
}
.strength-bar[data-score="1"] { width: 25%; background: var(--danger); }
.strength-bar[data-score="2"] { width: 50%; background: var(--warning); }
.strength-bar[data-score="3"] { width: 75%; background: #3b82f6; }
.strength-bar[data-score="4"] { width: 100%; background: var(--safe); }

.strength-label {
  font-size: .78rem;
  color: var(--text-muted);
  min-height: 1em;
  align-self: flex-end;
}

/* ── Botão principal ───────────────────────────────────────────────────────── */
.check-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .85rem;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  letter-spacing: .02em;
}

.check-btn:hover:not(:disabled) { opacity: .9; }
.check-btn:active:not(:disabled) { transform: scale(.98); }
.check-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Resultado ─────────────────────────────────────────────────────────────── */
.result {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: .95rem;
  line-height: 1.6;
  border: 1px solid transparent;
  animation: fadeIn .3s ease;
}
.result small { opacity: .75; font-size: .82rem; display: block; margin-top: .35rem; }

.result--safe    { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); }
.result--danger  { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.3); }
.result--warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); }

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

/* ── Como funciona ─────────────────────────────────────────────────────────── */
.how-it-works {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  backdrop-filter: blur(12px);
}

.how-it-works h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.how-it-works ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.how-it-works li strong { color: var(--text); }
.how-it-works li em     { color: var(--accent-light); font-style: normal; font-weight: 600; }

.note {
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.note a { color: var(--accent-light); text-decoration: none; }
.note a:hover { text-decoration: underline; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  opacity: .6;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 1rem .75rem 3rem; }
  .card, .how-it-works { padding: 1.25rem; }
  h1 { font-size: 1.5rem; }
}
