/* ============================================================
   Autenticação — Login (split) + Registro (card)
   Paleta: verde marca #1ab394 / #00b894, teal #23c6c8
   ============================================================ */

:root {
    --auth-green: #1ab394;
    --auth-green-dark: #128a72;
    --auth-teal: #23c6c8;
    --auth-ink: #2c3e50;
    --auth-muted: #7f8c8d;
    --auth-border: #e6ebee;
    --auth-danger: #ed5565;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #dfe4ea 100%);
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============================================================
   LOGIN — layout split (marca + formulário)
   ============================================================ */

.auth-split {
    display: flex;
    width: 100%;
    max-width: 920px;
    min-height: 540px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(44, 62, 80, 0.18);
    animation: authScaleIn 0.5s ease-out both;
}

/* --- Painel de marca (esquerda) --- */
.auth-brand {
    position: relative;
    flex: 0 0 42%;
    color: #fff;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.auth-brand-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(150deg, var(--auth-green) 0%, var(--auth-green-dark) 60%, #0c6b59 100%);
    z-index: 0;
}

/* blobs sutis animados no fundo do painel */
.auth-brand-bg::before,
.auth-brand-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: authFloat 9s ease-in-out infinite;
}
.auth-brand-bg::before { width: 240px; height: 240px; top: -70px; right: -60px; }
.auth-brand-bg::after { width: 180px; height: 180px; bottom: -50px; left: -40px; animation-delay: -4.5s; }

.auth-brand-content { position: relative; z-index: 1; }

.auth-brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 22px;
    backdrop-filter: blur(2px);
}

.auth-brand-name {
    font-size: 30px;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0 0 6px;
    line-height: 1.1;
}
.auth-brand-name span { font-weight: 600; }

.auth-brand-tagline {
    font-size: 14px;
    opacity: 0.85;
    margin: 0 0 32px;
}

.auth-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.auth-brand-features li {
    font-size: 13.5px;
    opacity: 0.92;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-brand-features li i {
    width: 18px;
    text-align: center;
    opacity: 0.9;
}

.auth-brand-foot {
    position: relative;
    z-index: 1;
    margin-top: 32px;
    font-size: 12px;
    opacity: 0.7;
}

/* --- Painel do formulário (direita) --- */
.auth-form-panel {
    flex: 1;
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-head { margin-bottom: 30px; }
.auth-form-title {
    color: var(--auth-ink);
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 6px;
}
.auth-form-subtitle {
    color: var(--auth-muted);
    font-size: 14.5px;
    margin: 0;
}

/* --- Campos com floating label --- */
.auth-field {
    position: relative;
    margin-bottom: 22px;
}

.auth-field-icon {
    position: absolute;
    left: 16px;
    top: 19px;
    color: #b3bcc4;
    font-size: 16px;
    transition: color 0.25s ease;
    z-index: 2;
}

.auth-input {
    width: 100%;
    padding: 18px 44px 8px;
    border: 2px solid var(--auth-border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--auth-ink);
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.auth-input.has-toggle { padding-right: 48px; }

.auth-input:focus {
    outline: none;
    border-color: var(--auth-green);
    box-shadow: 0 0 0 4px rgba(26, 179, 148, 0.12);
}
.auth-input:focus ~ .auth-field-icon { color: var(--auth-green); }

/* label flutuante */
.auth-field label {
    position: absolute;
    left: 44px;
    top: 15px;
    color: #9aa4ad;
    font-size: 15px;
    pointer-events: none;
    transition: all 0.18s ease;
    background: #fff;
    padding: 0 4px;
}
.auth-input:focus ~ label,
.auth-input:not(:placeholder-shown) ~ label {
    top: -9px;
    left: 38px;
    font-size: 12px;
    color: var(--auth-green);
    font-weight: 500;
}

/* botão olho */
.auth-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9aa4ad;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    z-index: 2;
}
.auth-toggle:hover { color: var(--auth-green); background: rgba(26, 179, 148, 0.08); }

/* mensagem de validação inline */
.auth-field-msg {
    display: block;
    color: var(--auth-danger);
    font-size: 12px;
    margin: 6px 2px 0;
    min-height: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.auth-field.is-invalid .auth-input {
    border-color: var(--auth-danger);
}
.auth-field.is-invalid .auth-input:focus {
    box-shadow: 0 0 0 4px rgba(237, 85, 101, 0.12);
}
.auth-field.is-invalid .auth-field-icon,
.auth-field.is-invalid label { color: var(--auth-danger); }
.auth-field.is-invalid .auth-field-msg { opacity: 1; }

/* --- Opções (lembrar / esqueceu) --- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 26px;
    font-size: 13.5px;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    cursor: pointer;
    margin: 0;
    user-select: none;
}
.auth-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--auth-green);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
    flex: 0 0 auto;
}
.auth-check input[type="checkbox"]:checked { background: var(--auth-green); }
.auth-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Botão entrar com spinner --- */
.auth-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-green) 0%, var(--auth-green-dark) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}
.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26, 179, 148, 0.32);
}
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { cursor: default; }

.auth-submit-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
}
.auth-submit.is-loading .auth-submit-label { display: none; }
.auth-submit.is-loading .auth-submit-spinner {
    display: inline-block;
    margin: 0 auto;
}
.auth-submit.is-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-register {
    text-align: center;
    margin: 24px 0 0;
    font-size: 13.5px;
    color: var(--auth-muted);
}

.auth-link {
    color: var(--auth-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.auth-link:hover { color: var(--auth-green-dark); text-decoration: underline; }

/* ============================================================
   Toast de erro (compartilhado)
   ============================================================ */
.custom-error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    width: 320px;
    background-color: #fff;
    border-left: 5px solid var(--auth-danger);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}
.custom-error.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.custom-error-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #fdecea;
    color: #b21f2d;
}
.custom-error-header-content { display: flex; align-items: center; }
.custom-error-icon {
    margin-right: 10px;
    color: var(--auth-danger);
    font-size: 16px;
    background-color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-error-title { font-weight: 500; font-size: 15px; margin: 0; }
.custom-error-close {
    background: none;
    border: none;
    color: #b21f2d;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.custom-error-body { padding: 14px 15px; color: #333; }
.custom-error-message { margin: 0; font-size: 14px; }

/* ============================================================
   Auxiliares — ícone, ajuda, info de contato, timeout, sucesso
   (usados em register.html e password_reset.html)
   ============================================================ */

/* ícone grande no topo do formulário (recuperar senha / registro) */
.auth-form-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(26, 179, 148, 0.1);
    color: var(--auth-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

/* texto de ajuda logo abaixo de um campo */
.auth-help {
    display: block;
    color: var(--auth-muted);
    font-size: 12.5px;
    margin: -12px 2px 0;
    line-height: 1.5;
}

/* contador de tempo para reenvio de email */
.auth-timeout {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-green);
}

/* caixa de informações de contato (registro) */
.auth-info {
    background: #f6f9f8;
    border: 1px solid var(--auth-border);
    border-left: 4px solid var(--auth-green);
    border-radius: 12px;
    padding: 22px 24px;
    text-align: left;
    margin-bottom: 20px;
}
.auth-info h3 {
    color: var(--auth-ink);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
}
.auth-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.auth-info-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #56616b;
    font-size: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #eaeff1;
}
.auth-info-list li:last-child { border-bottom: none; }
.auth-info-list li i {
    color: var(--auth-green);
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex: 0 0 auto;
}
.auth-info-list li a { color: inherit; text-decoration: none; }
.auth-info-list li a:hover { color: var(--auth-green); }

/* nota informativa de rodapé */
.auth-note {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: #6b7680;
    background: #fbf7ee;
    border-radius: 10px;
    padding: 12px 14px;
    line-height: 1.5;
    text-align: left;
}
.auth-note i { color: var(--auth-teal); margin-top: 2px; flex: 0 0 auto; }

/* toast de sucesso (variante do custom-error) */
.custom-success { border-left-color: var(--auth-green); }
.custom-success .custom-error-header { background-color: #e8f8f3; color: #0c6b59; }
.custom-success .custom-error-icon { color: var(--auth-green); }
.custom-success .custom-error-close { color: #0c6b59; }

/* ============================================================
   Animações
   ============================================================ */
@keyframes authScaleIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}
@keyframes authShake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}
.auth-shake { animation: authShake 0.5s ease; }

/* ============================================================
   Responsividade
   ============================================================ */
@media (max-width: 768px) {
    .auth-split {
        flex-direction: column;
        max-width: 440px;
        min-height: 0;
    }
    .auth-brand {
        flex: none;
        padding: 32px 32px 28px;
    }
    .auth-brand-features { display: none; }
    .auth-brand-foot { display: none; }
    .auth-brand-tagline { margin-bottom: 0; }
    .auth-form-panel { padding: 36px 32px 40px; }
    .login-title { font-size: 26px; }
    .register-box { padding: 30px 20px; }
}

/* Acessibilidade — reduzir movimento */
@media (prefers-reduced-motion: reduce) {
    .auth-split,
    .register-box,
    .auth-brand-bg::before,
    .auth-brand-bg::after,
    .auth-shake,
    .auth-submit-spinner {
        animation: none !important;
    }
    .auth-submit:hover { transform: none; }
}
