:root {
    --vix-primary: #1f4b57;
    --vix-primary-dark: #0f3038;
    --vix-accent: #3aa7a5;
    --vix-accent-soft: #7fd1cd;
    --vix-background: #0b141b;
    --vix-surface: #101923;
    --vix-border: rgba(148, 163, 184, 0.35);
    --vix-text: #e5e7eb;
    --vix-text-muted: #9ca3af;
    --radius-lg: 24px;
    --shadow-strong: 0 28px 90px rgba(0, 0, 0, 0.70);
    --transition-fast: 0.18s ease;
    --transition-med: 0.28s ease;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
                 Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    color: var(--vix-text);
    background: radial-gradient(circle at top left, #1f4b57 0, transparent 55%),
                radial-gradient(circle at bottom right, #3aa7a5 0, transparent 55%),
                linear-gradient(135deg, #020617 0%, #020617 40%, #020617 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.background-orbit {
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 999px;
    background: radial-gradient(circle at center,
        rgba(58, 167, 165, 0.32),
        transparent 60%);
    top: -120px;
    left: -120px;
    filter: blur(1px);
    opacity: 0.9;
    pointer-events: none;
    animation: floatOrbit 18s infinite alternate ease-in-out;
}

.background-orbit.orbit-2 {
    width: 460px;
    height: 460px;
    top: auto;
    bottom: -180px;
    left: auto;
    right: -120px;
    background: radial-gradient(circle at center,
        rgba(31, 75, 87, 0.40),
        transparent 60%);
    animation-duration: 22s;
}

.background-orbit.orbit-3 {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center,
        rgba(15, 23, 42, 0.70),
        transparent 65%);
    animation-duration: 26s;
}

.login-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    width: 100%;
    max-width: 1120px;
    margin: 1.5rem;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at top left, rgba(122, 196, 196, 0.18), transparent 55%),
                radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.85), #050b10 70%);
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--vix-border);
    overflow: hidden;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mobile-logo .brand-logo {
    margin-bottom: 0;
}

@media(max-width:880px){
    .mobile-logo { display: flex; }
    .brand-side { display:none; }
}

.brand-side {
    position: relative;
    padding: 3rem 2.75rem;
    background: linear-gradient(145deg,
        rgba(9, 16, 24, 0.98) 0%,
        rgba(15, 31, 43, 0.98) 40%,
        rgba(20, 42, 55, 0.98) 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.35);
    color: var(--vix-text);
}

.brand-side::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 0 0, rgba(191, 219, 254, 0.10), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(8, 47, 73, 0.55), transparent 70%);
    opacity: 0.9;
    pointer-events: none;
}

.brand-logo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.15rem;
    border-radius: 999px;
    background: radial-gradient(circle at 0 0, rgba(122, 196, 196, 0.45), transparent 65%),
                rgba(15, 23, 42, 0.96);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.95);
    margin-bottom: 1.8rem;
}

.brand-logo img {
    display: block;
    height: 62px;
    width: auto;
}

.brand-side h1 {
    position: relative;
    z-index: 1;
    font-size: 2.2rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    color: #f9fafb;
}

.brand-subtitle {
    position: relative;
    z-index: 1;
    font-size: 0.97rem;
    line-height: 1.75;
    color: #d1d5db;
    max-width: 420px;
    margin-bottom: 1.8rem;
}

.brand-features {
    position: relative;
    z-index: 1;
    list-style: none;
    margin-top: 1rem;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.92rem;
    color: #e5e7eb;
    opacity: 0.96;
}

.brand-features li + li {
    margin-top: 0.45rem;
}

.brand-features li::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--vix-accent), var(--vix-accent-soft));
    box-shadow: 0 0 0 4px rgba(58, 167, 165, 0.32);
}

.form-side {
    position: relative;
    padding: 3rem 2.5rem;
    background: radial-gradient(circle at top, rgba(13, 25, 36, 0.98), #050b10 60%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header h2 {
    font-size: 1.7rem;
    margin-bottom: 0.25rem;
}

.form-header p {
    font-size: 0.95rem;
    color: var(--vix-text-muted);
}

.login-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vix-text-muted);
}

.input-group input {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background: rgba(10, 18, 29, 0.95);
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    color: var(--vix-text);
    outline: none;
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast),
                background-color var(--transition-fast),
                transform 0.08s ease;
}

.input-group input::placeholder {
    color: #6b7280;
}

.input-group input:focus {
    border-color: var(--vix-accent);
    box-shadow:
        0 0 0 1px rgba(58, 167, 165, 0.65),
        0 18px 32px rgba(15, 23, 42, 0.85);
    background-color: #020617;
    transform: translateY(-1px);
}

.input-group input.has-error {
    border-color: #f97373;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.65);
}

.error-message {
    min-height: 16px;
    font-size: 0.78rem;
    color: #fecaca;
    padding-left: 0.35rem;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
    gap: 1rem;
    font-size: 0.83rem;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--vix-text-muted);
    cursor: pointer;
}

.remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    border-radius: 5px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background: transparent;
    accent-color: var(--vix-accent);
}

.forgot-link {
    color: var(--vix-accent-soft);
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

.forgot-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--vix-accent), var(--vix-accent-soft));
    opacity: 0;
    transform: scaleX(0.3);
    transform-origin: center;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.forgot-link:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

.btn-primary {
    margin-top: 1.6rem;
    width: 100%;
    border-radius: 999px;
    border: 0;
    padding: 0.9rem 1rem;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    color: #f9fafb;
    background: linear-gradient(135deg, var(--vix-primary), var(--vix-accent));
    box-shadow:
        0 18px 48px rgba(15, 23, 42, 0.90),
        0 0 0 1px rgba(27, 63, 74, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: transform 0.09s ease,
                box-shadow 0.09s ease,
                filter var(--transition-fast),
                background-position 0.28s ease;
    background-size: 170% 170%;
    background-position: 0% 50%;
}

.btn-primary span:first-child {
    position: relative;
    z-index: 1;
}

.btn-loader {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(248, 250, 252, 0.35);
    border-top-color: #f9fafb;
    animation: spin 0.7s linear infinite;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.98),
        0 0 0 1px rgba(15, 23, 42, 1);
    filter: brightness(1.05);
    background-position: 100% 50%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.98),
        0 0 0 1px rgba(15, 23, 42, 1);
}

.system-info {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.79rem;
    color: var(--vix-text-muted);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.92), rgba(0, 0, 0, 0.98));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
    z-index: 50;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    background: radial-gradient(circle at top left, rgba(122, 196, 196, 0.18), transparent 60%),
                #020617;
    border-radius: 18px;
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--vix-border);
    text-align: center;
    min-width: 260px;
}

.loading-card p {
    margin-top: 1rem;
    font-size: 0.96rem;
    color: var(--vix-text);
}

.spinner {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.5);
    border-top-color: var(--vix-accent-soft);
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* Animações básicas */
.fade-in {
    animation: fadeInUp 0.7s ease-out forwards;
}

.slide-left {
    animation: slideInLeft 0.7s ease-out forwards;
}

.slide-right {
    animation: slideInRight 0.7s ease-out forwards;
}

/* Responsividade */
@media (max-width: 880px) {
    .login-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .brand-side {
        display: none;
    }

    .form-side {
        padding: 2.6rem 2.1rem;
    }
}

@media (max-width: 540px) {
    body {
        align-items: flex-start;
        padding-top: 1.4rem;
    }

    .login-wrapper {
        margin: 0.75rem;
        border-radius: 18px;
    }

    .form-side {
        padding: 2rem 1.5rem;
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .system-info {
        margin-top: 1.4rem;
    }
}

/* Keyframes */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes floatOrbit {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(12px, -18px, 0);
    }
}
