/* ============================================================
   style.css v2 — Grupo Setec · Registro Facial · Gradiente Vibrante
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --verde1:       #0d5c2e;
    --verde2:       #1a8c48;
    --verde3:       #22b85e;
    --dourado1:     #c8860a;
    --dourado2:     #f0a818;
    --dourado3:     #ffd15c;
    --branco:       #ffffff;
    --branco-soft:  rgba(255,255,255,0.92);
    --branco-trans: rgba(255,255,255,0.15);
    --texto-escuro: #0a3d1f;
    --texto-medio:  #1a5c32;
    --muted:        rgba(255,255,255,0.65);
    --radius:       20px;
    --radius-sm:    12px;
    --shadow:       0 8px 32px rgba(0,0,0,0.18);
    --shadow-sm:    0 4px 16px rgba(0,0,0,0.12);
}

body {
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--verde1) 0%, var(--verde2) 45%, var(--verde3) 100%);
    overflow: hidden;
}

/* Efeito de brilho no fundo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 80% 10%, rgba(255,209,92,0.18) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 10% 90%, rgba(0,0,0,0.2) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.app {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 24px;
    position: relative;
    z-index: 1;
}

/* ── Telas ── */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 16px;
    animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.screen.active { display: flex; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Brand header ── */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 6px;
}

.brand-header img {
    width: 120px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.brand-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--branco);
    letter-spacing: -0.3px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.brand-header p {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
}

/* ── Card de conteúdo ── */
.card {
    background: var(--branco-trans);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius);
    padding: 20px;
    width: 100%;
}

/* ── Viewfinder ── */
.viewfinder {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: #000;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow);
}

.viewfinder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.viewfinder::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    width: 55%;
    aspect-ratio: 3/4;
    border-radius: 50% 50% 45% 45%;
    border: 2px solid rgba(255,209,92,0.7);
    pointer-events: none;
    box-shadow: 0 0 20px rgba(255,209,92,0.2);
}

/* ── Preview ── */
.preview {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow);
}
.preview img { width: 100%; height: 100%; object-fit: cover; }

#canvas { display: none; }

/* ── Formulário CPF/Senha ── */
.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--branco);
    letter-spacing: 0.3px;
}

.input-wrap { position: relative; width: 100%; }

.input-wrap input {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--branco);
    outline: none;
    transition: all 0.2s;
}

.input-wrap input::placeholder { color: rgba(255,255,255,0.45); }

.input-wrap input:focus {
    border-color: var(--dourado3);
    background: rgba(255,255,255,0.2);
}

.input-wrap input.error {
    border-color: #ff6b6b;
    background: rgba(255,107,107,0.1);
}

.input-wrap input[type="password"],
.input-wrap input[type="text"].senha-field {
    padding-right: 48px;
}

.btn-eye {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: rgba(255,255,255,0.6);
    padding: 4px;
    line-height: 1;
}

.field-error {
    font-size: 12px;
    color: #ffadad;
    min-height: 16px;
}

/* ── Botões ── */
.btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    letter-spacing: 0.2px;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--dourado2), var(--dourado3));
    color: var(--texto-escuro);
    box-shadow: 0 4px 20px rgba(240,168,24,0.4);
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(240,168,24,0.55);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--branco-trans);
    color: var(--branco);
    border: 1.5px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(8px);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.5);
}

.btn-danger {
    background: rgba(255,80,80,0.15);
    color: #ffadad;
    border: 1.5px solid rgba(255,80,80,0.3);
}

/* ── Botão captura circular ── */
.capture-row { display: flex; align-items: center; justify-content: center; width: 100%; }

.btn-capture {
    width: 76px; height: 76px;
    border-radius: 50%;
    border: 3px solid var(--dourado3);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(255,209,92,0.35);
}
.btn-capture::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dourado2), var(--dourado3));
    transition: all 0.2s;
}
.btn-capture:active { transform: scale(0.92); }
.btn-capture:active::after { background: var(--branco); }

/* ── Feedback ── */
.feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.feedback-icon {
    width: 84px; height: 84px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
}

.feedback-icon.sending {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,209,92,0.5);
    animation: pulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 24px rgba(255,209,92,0.2);
}
.feedback-icon.success {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(100,255,160,0.5);
    box-shadow: 0 0 24px rgba(100,255,160,0.15);
}
.feedback-icon.error {
    background: rgba(255,80,80,0.12);
    border: 2px solid rgba(255,80,80,0.35);
}

@keyframes pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(1.08); opacity: 0.75; }
}

.feedback h2 { font-size: 22px; font-weight: 600; color: var(--branco); }
.feedback p  { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── Badge ── */
.badge {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(255,209,92,0.18);
    color: var(--dourado3);
    border: 1px solid rgba(255,209,92,0.35);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* ── Divisor dourado ── */
.accent-bar {
    width: 52px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--dourado2), var(--dourado3));
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(255,209,92,0.4);
}