/* ==========================================================================
   SYST TEAM — AUTHENTICATION STYLES (auth.css)
   ========================================================================== */

:root {
    --bg: #0F3D3A;
    --surface: #FFF9F1;
    --accent: #6C151E;
    --accent-hover: #521017;
    --text: #241B19;
    --muted: #665750;
    --subtle: #88776D;
    --border: rgba(15, 61, 58, .16);
    --input: #FFFCF7;
    --cream: #F5DABF;
    --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% -15%, rgba(245, 218, 191, .16), transparent 32rem),
        linear-gradient(145deg, #0F3D3A, #082D2B 70%, #061F1E);
    color: var(--text);
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* AMBIENT BACKGROUND */
body::before {
    content: "";
    position: fixed;
    width: 650px;
    height: 650px;
    top: -380px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(108, 21, 30, .24), transparent 70%);
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(245, 218, 191, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 218, 191, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 75%);
    pointer-events: none;
}

/* LAYOUT */
.auth-layout {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
    animation: appear .55s cubic-bezier(.2, .8, .2, 1);
}

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

/* LINK VOLTAR */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: rgba(245, 218, 191, .8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: color .2s ease;
}

.back-link:hover {
    color: var(--cream);
}

.back-icon {
    transition: transform .2s ease;
}

.back-link:hover .back-icon {
    transform: translateX(-4px);
}

/* CARD PRINCIPAL */
.auth-card {
    width: 100%;
    padding: clamp(28px, 5vw, 42px);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .65), rgba(255, 255, 255, .25) 46%),
        var(--surface);
    border: 1px solid rgba(245, 218, 191, .35);
    border-radius: 26px;
    box-shadow:
        0 34px 90px rgba(3, 22, 21, .38),
        inset 0 1px 0 rgba(255, 255, 255, .85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--bg), transparent);
}

/* HEADER */
.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo-wrapper {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: rgba(15, 61, 58, .06);
    border: 1px solid rgba(15, 61, 58, .13);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 61, 58, .08);
}

.auth-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--bg);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(108, 21, 30, .12);
}

.auth-title {
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -1.2px;
    font-weight: 800;
    color: var(--bg);
    margin-bottom: 8px;
}

.auth-title span {
    color: var(--accent);
}

.auth-subtitle {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

/* TABS */
.auth-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    margin-bottom: 24px;
    background: #F0E0CE;
    border: 1px solid rgba(15, 61, 58, .12);
    border-radius: 13px;
}

.tab-btn {
    flex: 1;
    padding: 11px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #77665D;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
}

.tab-btn:hover:not(.active) {
    color: var(--bg);
    background: rgba(15, 61, 58, .06);
}

.tab-btn.active {
    color: var(--cream);
    background: var(--bg);
    border-color: rgba(15, 61, 58, .2);
    box-shadow: 0 5px 14px rgba(15, 61, 58, .18);
}

/* FORMULÁRIOS */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    color: var(--bg);
    font-size: 12px;
    font-weight: 800;
}

/* INPUTS E ÍCONES */
.input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8A766B;
    pointer-events: none;
    z-index: 1;
    transition: color .2s ease;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    background: var(--input);
    border: 1px solid rgba(15, 61, 58, .18);
    border-radius: 11px;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.form-group input::placeholder {
    color: #9A887D;
}

.form-group input:hover {
    border-color: rgba(15, 61, 58, .35);
}

.form-group input:focus {
    background: #FFFFFF;
    border-color: rgba(108, 21, 30, .65);
    box-shadow: 0 0 0 3px rgba(108, 21, 30, .09), 0 8px 18px rgba(108, 21, 30, .045);
}

.input-wrapper:focus-within .input-icon {
    color: var(--accent);
}

/* BOTÃO DE VISUALIZAR SENHA */
.password-wrapper input {
    padding-right: 44px;
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #8A766B;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}

.toggle-password-btn:hover {
    color: var(--bg);
    background: rgba(15, 61, 58, .08);
}

/* AVATAR DO LOGIN */
.login-email-wrapper input {
    padding-right: 54px;
}

.login-avatar-container {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: #EBD8C3;
    border: 1px solid rgba(15, 61, 58, .16);
    color: var(--bg);
    font-size: 12px;
    font-weight: 800;
    transition: .2s ease;
    pointer-events: none;
}

.login-avatar-container span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-avatar-container img {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    border-radius: 50%;
    opacity: 0;
    transition: opacity .25s ease;
}

.login-avatar-container img.loaded {
    opacity: 1;
}

.login-avatar-container.has-photo {
    border-color: rgba(15, 61, 58, .45);
    box-shadow: 0 0 0 3px rgba(15, 61, 58, .08);
}

/* BOTÃO SUBMIT */
.btn-submit {
    width: 100%;
    height: 50px;
    margin-top: 6px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(145deg, #8A3541, #6C151E 75%);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 12px;
    color: #FFF9F1;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(108, 21, 30, .2);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.btn-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(108, 21, 30, .28);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:focus-visible,
.tab-btn:focus-visible,
.toggle-password-btn:focus-visible {
    outline: 2px solid var(--bg);
    outline-offset: 3px;
}

.button-arrow {
    transition: transform .2s ease;
}

.btn-submit:hover .button-arrow {
    transform: translateX(4px);
}

/* ALERTAS */
.alert-box {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.alert-box.error {
    background: rgba(108, 21, 30, .08);
    border: 1px solid rgba(108, 21, 30, .25);
    color: #6C151E;
}

.alert-box.success {
    background: rgba(15, 61, 58, .08);
    border: 1px solid rgba(15, 61, 58, .25);
    color: #0F3D3A;
}

/* FOOTER */
.auth-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 61, 58, .13);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.footer-separator {
    color: var(--accent);
}

/* DECORAÇÃO INFERIOR */
.bottom-decoration {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}

.bottom-decoration span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(245, 218, 191, .35);
}

.bottom-decoration span:first-child {
    background: var(--cream);
}

/* RESPONSIVIDADE */
@media (max-width: 520px) {
    body {
        padding: 25px 16px;
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .auth-title {
        font-size: 26px;
    }
}

@media (max-width: 380px) {
    .form-row {
        flex-direction: column;
        gap: 18px;
    }
}

/* ACESSIBILIDADE */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}