@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --bg: #edeef2;
    --card: #ffffff;
    --text: #2c3041;
    --text-muted: #7a8098;
    --border: rgba(0, 0, 0, 0.08);
    --accent: #3b4668;
    --accent-hover: #2d3650;
    --error: #c5391a;
    --error-bg: #fdf0ec;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 24px rgba(0,0,0,0.06);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Subtle background grid ── */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.018) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ── Card ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 28px 32px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 380px;
    text-align: center;
    animation: cardIn 0.5s ease-out;
}

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

/* ── Lock icon ── */
.lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Typography ── */
h1 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-weight: 400;
}

/* ── Form ── */
form {
    text-align: left;
}

.pin-group {
    margin-bottom: 16px;
}

.pin-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.pin-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    letter-spacing: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.pin-input::placeholder {
    color: #c0c4d4;
    letter-spacing: 4px;
    font-size: 20px;
}

.pin-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 70, 104, 0.1);
    background: #fff;
}

/* ── Error ── */
.erro {
    background: var(--error-bg);
    color: var(--error);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid rgba(197, 57, 26, 0.12);
    animation: shakeIn 0.4s ease;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* ── Shake class for input ── */
.shake {
    animation: shakeIn 0.4s ease;
}

/* ── Button ── */
.btn-entrar {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.btn-entrar:hover {
    background: var(--accent-hover);
}

.btn-entrar:active {
    transform: scale(0.98);
}

/* ── Disclaimer ── */
.disclaimer {
    margin-top: 24px;
    font-size: 11.5px;
    color: var(--text-muted);
    opacity: 0.7;
    line-height: 1.5;
}

/* ── Footer ── */
.foot {
    margin-top: 28px;
    font-size: 11.5px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ── Mobile ── */
@media (max-width: 420px) {
    .card {
        padding: 28px 20px 24px;
        border-radius: 14px;
    }

    h1 {
        font-size: 17px;
    }

    .pin-input {
        padding: 16px 14px;
        font-size: 20px;
    }

    .btn-entrar {
        padding: 16px;
    }
}
