/*
 * Biotech Ambiental — Login Page
 * Split-screen: branding panel (left) + form panel (right)
 * Version: 3.2
 */

:root {
    --primary:        #4a6b5f;
    --primary-dark:   #3a554a;
    --accent:         #5a8c7a;
    --accent-light:   #8fbfb0;

    --panel-bg:       #2c3e3a;
    --panel-bg2:      #3a4f48;

    --light:          #f4f3f0;
    --light-alt:      #eceae3;
    --border:         #dedad2;
    --border-focus:   #4a6b5f;

    --text-dark:      #2c3e3a;
    --text-muted:     #8a9a95;
    --text-white:     #ffffff;
    --text-white-75:  rgba(255,255,255,0.75);
    --text-white-50:  rgba(255,255,255,0.50);

    --shadow-logo:    0 8px 32px rgba(0,0,0,0.22);
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      18px;
}

/* ── RESET / BASE ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--panel-bg);
}

/* ── SPLIT-SCREEN CONTAINER ── */
.login-container {
    display: flex;
    min-height: 100vh;
}

/* ══════════════════════════════════════
   PAINEL ESQUERDO — BRANDING
══════════════════════════════════════ */
.branding-section {
    flex: 0 0 44%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* Gradiente + mesh sutil sobreposto */
    background-color: var(--panel-bg);
    background-image:
        linear-gradient(rgba(90,140,122,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90,140,122,0.035) 1px, transparent 1px),
        linear-gradient(150deg, var(--panel-bg) 0%, var(--panel-bg2) 55%, #2a4840 100%);
    background-size: 44px 44px, 44px 44px, 100% 100%;
}

/* Círculo decorativo — topo direito */
.branding-section::before {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    top: -200px;
    right: -210px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(90,140,122,0.16) 0%, transparent 65%);
    pointer-events: none;
}

/* Círculo decorativo — base esquerda */
.branding-section::after {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    bottom: -130px;
    left: -110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74,107,95,0.20) 0%, transparent 65%);
    pointer-events: none;
}

/* Wrapper de conteúdo — acima das decorações */
.branding-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 52px 48px;
    gap: 0;
}

/* ── Topo ── */
.branding-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.97);
    border-radius: var(--radius-md);
    padding: 16px 26px;
    box-shadow: var(--shadow-logo);
    margin-bottom: 26px;
    align-self: flex-start;
}

.branding-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 120px;
}

.branding-headline h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-white);
    margin: 0 0 7px;
    line-height: 1.2;
    letter-spacing: -0.4px;
}

.branding-headline p {
    font-size: 0.9rem;
    color: var(--text-white-75);
    margin: 0;
    line-height: 1.55;
}

/* ── Features ── */
.features-block {
    margin-top: 42px;
    flex: 1;
}

.features-label {
    font-size: 0.69rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-white-50);
    margin: 0 0 16px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.features-list li:last-child { border-bottom: none; }

.features-list .feat-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--accent-light);
    margin-top: 1px;
}

.features-list li > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.features-list li strong {
    font-size: 0.84rem;
    font-weight: 600;
    color: rgba(255,255,255,0.88);
    line-height: 1.3;
}

.features-list li span {
    font-size: 0.775rem;
    color: var(--text-white-50);
    line-height: 1.4;
}

/* ── Footer ── */
.branding-footer {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.branding-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 100px;
    padding: 5px 14px 5px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-light);
    margin-bottom: 14px;
}

.branding-footer p {
    font-size: 0.775rem;
    color: var(--text-white-50);
    margin: 0;
    line-height: 1.7;
}

/* ══════════════════════════════════════
   PAINEL DIREITO — FORMULÁRIO
══════════════════════════════════════ */
.login-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background-color: #edecea;
    background-image: radial-gradient(circle, rgba(74,107,95,0.07) 1px, transparent 1px);
    background-size: 24px 24px;
}

.login-box {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow:
        0 1px 3px rgba(44,62,58,0.04),
        0 8px 24px rgba(44,62,58,0.08),
        0 28px 72px rgba(44,62,58,0.12);
    overflow: hidden;
    animation: slideUp 0.44s cubic-bezier(0.22,1,0.36,1) both;
    border: 1px solid rgba(0,0,0,0.048);
}

/* Barra gradiente no topo do card */
.login-box::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-dark), var(--accent), var(--accent-light));
}

/* ── Cabeçalho do card ── */
.login-header {
    padding: 32px 40px 18px;
    text-align: center;
}

.login-brand-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(74,107,95,0.12);
    box-shadow:
        0 2px 6px rgba(44,62,58,0.07),
        0 8px 24px rgba(74,107,95,0.11);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    overflow: hidden;
}

.login-brand-img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    display: block;
}

.login-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 5px;
    letter-spacing: -0.3px;
}

.login-header p {
    font-size: 0.845rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Corpo do card ── */
.login-body {
    padding: 8px 40px 36px;
}

/* ── Alerta de erro ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    border: none !important;
}

.alert-danger {
    background: #fff1f0;
    color: #b23c3c;
    border-left: 3px solid #e05252 !important;
}

.alert-danger i { margin-top: 2px; flex-shrink: 0; }

/* Animação de erro */
.shake {
    animation: shake 0.48s cubic-bezier(0.36,0.07,0.19,0.97) both;
}

@keyframes shake {
    10%, 90%       { transform: translateX(-2px); }
    20%, 80%       { transform: translateX(3px); }
    30%, 50%, 70%  { transform: translateX(-4px); }
    40%, 60%       { transform: translateX(4px); }
}

/* ── Campos de formulário ── */
.form-group { margin-bottom: 18px; }

/* Linha de label com link "esqueceu a senha" */
.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.01em;
}

.form-label-row .form-label { margin-bottom: 0; }

.forgot-link {
    font-size: 0.775rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.15s, color 0.15s;
}

.forgot-link:hover {
    opacity: 1;
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Wrapper para ícone + botão dentro do input */
.input-wrapper { position: relative; }

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8125rem;
    pointer-events: none;
    z-index: 2;
}

/* Sobrescreve Bootstrap completamente */
.login-body .form-control {
    width: 100%;
    padding: 11px 42px 11px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--text-dark);
    background: #fafaf8;
    font-family: inherit;
    box-shadow: none !important;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-body .form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(74,107,95,0.13) !important;
}

.login-body .form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}

/* Botão de mostrar/ocultar senha */
.btn-toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px 7px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1;
    transition: color 0.18s;
    z-index: 2;
}

.btn-toggle-pw:hover { color: var(--primary); }
.btn-toggle-pw:focus { outline: 2px solid var(--border-focus); border-radius: 4px; }

/* ── Botão de submit ── */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 20px;
    margin-top: 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.015em;
}

.btn-submit:hover {
    box-shadow: 0 6px 24px rgba(44,68,58,0.35);
    transform: translateY(-1px);
}

.btn-submit:active { transform: translateY(0); box-shadow: none; }
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Rodapé do card ── */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--light-alt);
}

.login-footer-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    opacity: 0.7;
    margin-bottom: 8px;
}

.login-footer p {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.7;
}

/* ── Animação de entrada do card ── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ══════════════════════════════════════
   RESPONSIVO
══════════════════════════════════════ */
@media (max-width: 960px) {
    .login-container  { flex-direction: column; }

    .branding-section { flex: none; }

    .branding-inner {
        flex-direction: row;
        align-items: center;
        padding: 22px 24px;
        gap: 0;
    }

    .branding-top {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .branding-logo-box {
        padding: 8px 14px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .branding-logo     { max-width: 88px; max-height: 54px; }
    .branding-headline h1 { font-size: 1.1rem; }
    .branding-headline p  { font-size: 0.82rem; }

    .features-block,
    .branding-footer   { display: none; }

    .login-card        { padding: 28px 16px 44px; }
    .login-brand-badge { width: 64px; height: 64px; }
    .login-brand-img   { width: 46px; height: 46px; }
}

@media (max-width: 480px) {
    .login-header { padding: 26px 28px 14px; }
    .login-body   { padding: 6px 28px 28px; }
}

/* ══════════════════════════════════════
   DARK MODE — painel direito apenas
══════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    .login-card {
        background-color: #1e2a26;
    }

    .login-box {
        background: #243028;
        border-color: rgba(255,255,255,0.05);
        box-shadow: 0 28px 72px rgba(0,0,0,0.45);
    }

    .login-header h2 { color: #ddeee6; }
    .login-header p  { color: #7a9a8e; }

    .login-body .form-control {
        background: #1c2820;
        border-color: #3a4f48;
        color: #ddeee6;
    }

    .login-body .form-control:focus {
        background: #1f2f28;
        border-color: var(--accent);
    }

    .login-body .form-control::placeholder {
        color: #5a7a72;
        opacity: 1;
    }

    .form-label       { color: #c8ddd6; }
    .forgot-link      { color: var(--accent-light); }
    .login-footer     { border-top-color: #2e3f39; }
    .login-footer p   { color: #5a7a72; }
    .login-footer-secure { color: var(--accent-light); opacity: 0.7; }

    .alert-danger {
        background: #2d1a1a;
        color: #e07a7a;
        border-left-color: #c05252 !important;
    }
}
