@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --red: #E63946;
    --red-dark: #DC2626;
    --red-soft: #F05260;
    --bg: #1A1B1E;
    --bg-card: #232428;
    --bg-side: #2B2D31;
    --bg-input: #1E1F22;
    --bg-input-focus: #25262A;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #FFFFFF;
    --text-muted: #B5BAC1;
    --text-dim: #80848E;
    --success: #23A559;
    --warning: #F59E0B;
    --danger: #DC2626;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

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

html, body { height: 100%; }

body {
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

body::before, body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}
body::before {
    width: 480px; height: 480px;
    background: var(--red);
    top: -180px; left: -180px;
}
body::after {
    width: 380px; height: 380px;
    background: #5865F2;
    bottom: -120px; right: -120px;
}

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ===================== CONTAINER ===================== */

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 820px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ===================== SIDE BRAND ===================== */

.auth-side {
    position: relative;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    overflow: hidden;
    min-height: 0;
}
.auth-side::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}
.auth-brand .logo-box {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 4px;
    flex-shrink: 0;
}
.auth-brand .logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.auth-brand h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.1;
}
.auth-brand small {
    display: block;
    font-size: 10.5px;
    opacity: 0.85;
    margin-top: 2px;
    letter-spacing: 0.4px;
}

.auth-welcome { position: relative; margin-top: 32px; }
.auth-welcome h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}
.auth-welcome p {
    opacity: 0.92;
    font-size: 12.5px;
    line-height: 1.55;
}

.auth-features {
    list-style: none;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
}
.auth-features li svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.18);
    border-radius: 4px;
    padding: 3px;
    stroke-width: 2.5;
    display: block;
}

/* ===================== FORM ===================== */

.auth-form {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-form .title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.auth-form .subtitle {
    color: var(--text-dim);
    font-size: 12.5px;
    margin-bottom: 20px;
}

/* ===================== FIELDS ===================== */

.field { margin-bottom: 12px; }

.field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-control {
    position: relative;
    height: 42px;
}

.field-input {
    width: 100%;
    height: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 0 14px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field-input::placeholder { color: var(--text-dim); }
.field-input:hover { border-color: rgba(255, 255, 255, 0.22); }
.field-input:focus {
    border-color: var(--red);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15);
}

/* Variante: campo com ícone à esquerda */
.field-control.with-icon .field-input { padding-left: 38px; }
.field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    pointer-events: none;
    transition: color 0.2s var(--ease);
    z-index: 1;
}
.field-control.with-icon:focus-within .field-icon { color: var(--red); }

/* Variante: campo com toggle de senha à direita */
.field-control.with-toggle .field-input { padding-right: 40px; }

.pw-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    color: var(--text-dim);
    border-radius: 6px;
    display: grid;
    place-items: center;
    transition: color 0.18s var(--ease), background 0.18s var(--ease);
    z-index: 2;
}
.pw-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
}
.pw-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}
.pw-btn:active { background: rgba(255, 255, 255, 0.1); }

/* ===================== SELECT ===================== */

select.field-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B5BAC1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
select.field-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23E63946' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
select.field-input option {
    background: var(--bg-card);
    color: var(--text);
    padding: 8px;
}
select.field-input option:disabled { color: var(--text-dim); }

/* ===================== ROW DUPLO ===================== */

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.field-row .field { margin-bottom: 0; }

/* ===================== SUBMIT ===================== */

.btn-submit {
    width: 100%;
    height: 42px;
    background: var(--red);
    color: #fff;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: background 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}
.btn-submit::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transform: translate(-50%, -50%);
    transition: width 0.55s, height 0.55s;
}
.btn-submit:hover::before { width: 600px; height: 600px; }
.btn-submit:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(230, 57, 70, 0.32);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===================== LINK INFERIOR ===================== */

.auth-link {
    text-align: center;
    margin-top: 16px;
    color: var(--text-dim);
    font-size: 12.5px;
}
.auth-link a {
    color: var(--red);
    font-weight: 600;
    transition: color 0.2s var(--ease);
}
.auth-link a:hover { color: var(--red-soft); }

/* ===================== ALERTS ===================== */

.alert {
    padding: 9px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 12.5px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-left: 3px solid;
    line-height: 1.4;
    animation: slideIn 0.3s var(--ease);
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error { background: rgba(220, 38, 38, 0.12); color: var(--danger); border-color: var(--danger); }
.alert-success { background: rgba(35, 165, 89, 0.12); color: var(--success); border-color: var(--success); }

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

/* ===================== INFO BAR ===================== */

.info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--bg-side);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 14px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}
.info-bar-left { display: flex; align-items: center; gap: 7px; }
.info-bar-left svg { color: var(--text-dim); flex-shrink: 0; width: 13px; height: 13px; }
.info-bar .badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: rgba(35, 165, 89, 0.15);
    color: var(--success);
    white-space: nowrap;
}
.info-bar .badge.full { background: rgba(220, 38, 38, 0.15); color: var(--danger); }

/* ===================== HINT BOX ===================== */

.hint-box {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    background: var(--bg-side);
    border: 1px solid var(--border);
    border-left: 2px solid var(--red);
    border-radius: 6px;
    padding: 8px 10px;
    margin: -2px 0 14px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.45;
}
.hint-box svg { width: 12px; height: 12px; }
.hint-box svg {
    flex-shrink: 0;
    color: var(--red);
    margin-top: 1px;
}

/* ===================== EMPTY STATE ===================== */

.empty-state {
    text-align: center;
    padding: 24px 0 12px;
}
.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    display: inline-grid;
    place-items: center;
    margin-bottom: 16px;
}
.empty-state h4 {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}
.empty-state p {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 820px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
    .auth-side { display: none; }
    .auth-form { padding: 32px 26px; }
}

@media (max-width: 480px) {
    body { padding: 12px; }
    body::before, body::after { display: none; }
    .auth-form { padding: 28px 20px; }
    .field-row { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
    .field-row .field { margin-bottom: 12px; }
}
