/* Login no padrão do Sistema de Controle de Estoque (split + fundo rodovia) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

body.login-page {
    --ink: #1a1430;
    --ink-soft: #5b5675;
    --app-accent-grad: linear-gradient(90deg, #4c1d95 0%, #7c3aed 45%, #db2777 100%);
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --font-display: "Outfit", "Segoe UI", sans-serif;
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: hidden;
    background: #1a0f36 !important;
    font-family: var(--font-body);
    color: var(--ink);
    margin: 0;
}

body.login-page .header,
body.login-page header {
    display: none !important;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.06);
    animation: login-bg-ken 32s ease-in-out infinite alternate;
}

.login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(26, 15, 54, 0.55) 0%, rgba(76, 29, 149, 0.28) 45%, rgba(15, 8, 35, 0.5) 100%);
    transition: opacity 0.8s ease;
}

.login-intro .login-bg::after {
    opacity: 0.35;
}

@keyframes login-bg-ken {
    from { transform: scale(1.05) translate3d(0, 0, 0); }
    to { transform: scale(1.14) translate3d(-1.5%, 1%, 0); }
}

/* Contagem regressiva antes do card de login */
.login-countdown {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    pointer-events: none;
    text-align: center;
    color: #fff;
    animation: login-countdown-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.login-countdown--out {
    opacity: 0;
    transform: scale(1.08);
}

.login-countdown__label {
    margin: 0;
    font-family: var(--font-display, "Outfit", "Segoe UI", sans-serif);
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.login-countdown__value {
    margin: 0;
    font-family: var(--font-display, "Outfit", "Segoe UI", sans-serif);
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #fff;
    text-shadow: 0 8px 32px rgba(124, 58, 237, 0.55), 0 2px 20px rgba(0, 0, 0, 0.4);
}

.login-countdown__value span {
    display: inline-block;
    min-width: 1.1em;
    animation: login-countdown-pulse 1s ease-in-out infinite;
}

.login-countdown__unit {
    margin: 0.15rem 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

@keyframes login-countdown-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes login-countdown-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.92; }
}

.login-flash {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle at 50% 48%, #ffffff 0%, rgba(255, 255, 255, 0.92) 18%, rgba(255, 230, 190, 0.55) 42%, rgba(255, 255, 255, 0) 72%);
    mix-blend-mode: screen;
}

.login-flash-on .login-flash {
    animation: login-light-flash 0.75s ease-out forwards;
}

@keyframes login-light-flash {
    0% { opacity: 0; transform: scale(0.7); }
    28% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1.35); }
}

.login-intro .login-shell {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.9) translateY(18px);
}

.login-reveal .login-shell {
    visibility: visible;
    pointer-events: auto;
    animation: login-shell-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes login-shell-in {
    0% {
        opacity: 0;
        transform: scale(0.88) translateY(22px);
        filter: brightness(2.4) blur(2px);
    }
    45% {
        opacity: 1;
        filter: brightness(1.35) blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: brightness(1) blur(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-bg-media {
        animation: none;
        transform: scale(1.04);
    }

    .login-countdown,
    .login-countdown__value span {
        animation: none;
    }

    .login-flash-on .login-flash,
    .login-reveal .login-shell {
        animation: none;
    }

    .login-intro .login-shell,
    .login-reveal .login-shell {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        filter: none;
    }
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    min-height: min(620px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 30px 80px rgba(20, 8, 50, 0.45);
}

.login-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(160deg, #312e81 0%, #6d28d9 42%, #db2777 100%);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.login-hero-orb-a {
    width: 280px;
    height: 280px;
    right: -80px;
    top: -40px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.85), rgba(56, 189, 248, 0.05) 70%);
}

.login-hero-orb-b {
    width: 220px;
    height: 220px;
    left: -70px;
    bottom: 40px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.9), rgba(244, 114, 182, 0.05) 70%);
}

.login-hero-orb-c {
    width: 160px;
    height: 160px;
    right: 18%;
    bottom: -30px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.75), transparent 70%);
}

.login-hero-content {
    position: relative;
    z-index: 1;
    margin-top: 48px;
}

.login-logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 10px 0 0 -3px rgba(255, 255, 255, 0.35);
    margin-bottom: 28px;
    position: relative;
}

.login-logo-mark::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.55);
}

.login-brand-logo {
    display: block;
    max-width: 180px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 0 24px;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
}

.login-brand-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: -12px 0 28px;
    opacity: 0.95;
}

.login-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 2.6rem);
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #fff !important;
    text-align: left;
}

.login-hero-content p {
    margin: 0;
    max-width: 280px;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}

.login-hero-foot {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 36px 28px;
    background: #fff;
}

.login-card {
    width: min(360px, 100%);
    max-width: none;
    margin: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    text-align: left;
}

.login-card h2 {
    font-family: var(--font-display);
    margin: 0 0 6px;
    font-size: 1.85rem;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--ink);
}

.login-panel-lead {
    margin: 0 0 28px;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.login-form .field-underline {
    margin-bottom: 22px;
}

.login-form .field-underline label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #8b849e;
}

.login-form .field-underline input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #d8d2e6;
    border-radius: 0;
    padding: 8px 0 10px;
    background: transparent;
    outline: none;
    transition: border-color 0.15s;
    color: var(--ink);
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.login-form .field-underline input:focus {
    border-bottom-color: #7c3aed;
    box-shadow: none;
    background: transparent;
}

.btn-login {
    width: 100%;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-radius: 8px;
    padding: 14px 18px;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.86rem;
    font-family: inherit;
    background: var(--app-accent-grad);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.35);
    transition: transform 0.15s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    color: #fff;
}

.btn-login-arrow {
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 400;
}

.login-flash-msg {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(45, 30, 90, 0.1);
    font-size: 0.9rem;
}

.login-flash-error,
.login-flash-danger {
    background: #f8e4e0;
    color: #9f1239;
}

.login-flash-warning {
    background: #f5ecd4;
    color: #92400e;
}

.login-flash-success {
    background: #e4f3ee;
    color: #047857;
}

.login-flash-info,
.login-flash-message {
    background: #e8eef3;
    color: #1e3a5f;
}

.login-credits {
    margin-top: 1.75rem;
    font-size: 0.75rem;
    color: #9b95ad;
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 820px) {
    body.login-page {
        padding: 12px;
        place-items: start center;
        overflow-y: auto;
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        width: 100%;
    }

    .login-hero {
        min-height: 220px;
        padding: 28px 24px;
    }

    .login-hero-content {
        margin-top: 12px;
    }

    .login-hero h1 {
        font-size: 1.8rem;
    }
}
