* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --bg-deep: #08111f;
    --bg-mid: #0d1726;
    --bg-panel: rgba(18, 31, 50, 0.86);
    --bg-panel-alt: rgba(21, 34, 54, 0.88);
    --bg-muted: #0b1423;
    --bg-input: rgba(11, 20, 35, 0.94);
    --border: rgba(82, 103, 132, 0.34);
    --border-strong: rgba(88, 112, 145, 0.46);
    --text-main: #f8fafc;
    --text-soft: #94a3b8;
    --text-muted: #cbd5e1;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --success-bg: #102317;
    --success-border: #1f5133;
    --success-text: #c7f1d5;
    --error-bg: #2d1416;
    --error-border: #6b2026;
    --error-text: #fecaca;
    --shadow-lg: 0 18px 48px rgba(2, 6, 23, 0.18), 0 2px 10px rgba(2, 6, 23, 0.08);
    --shadow-sm: 0 10px 24px rgba(2, 6, 23, 0.16);
}

html,
body {
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
}

body {
    display: grid;
    place-items: center;
    padding: 24px 16px 56px;
    color: var(--text-main);
    background:
        radial-gradient(circle at 50% 34%, rgba(46, 92, 168, 0.24), transparent 0 28%),
        radial-gradient(circle at 50% 36%, rgba(30, 69, 132, 0.28), transparent 0 44%),
        linear-gradient(145deg, #0d1730 0%, #09111f 100%);
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 34%, rgba(63, 125, 230, 0.16), transparent 0 18%),
        radial-gradient(circle at 50% 36%, rgba(24, 77, 171, 0.12), transparent 0 34%);
    z-index: 0;
}

body::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, transparent 52%, rgba(3, 8, 18, 0.18) 76%, rgba(2, 6, 14, 0.42) 100%);
    z-index: 0;
}

body.modal-open {
    overflow: hidden;
}

.bubbles-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -160px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 35%;
    animation: rise linear infinite;
    opacity: 0;
    will-change: transform, opacity;
}

@keyframes rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0.26;
    }
    85% {
        opacity: 0.26;
    }
    100% {
        transform: translateY(-130vh) rotate(360deg);
        opacity: 0;
    }
}

.bubble:nth-child(1) { left: 5%; width: 60px; height: 60px; animation-duration: 8s; animation-delay: 0s; }
.bubble:nth-child(2) { left: 15%; width: 100px; height: 100px; animation-duration: 12s; animation-delay: 1.2s; }
.bubble:nth-child(3) { left: 25%; width: 40px; height: 40px; animation-duration: 7s; animation-delay: 2.4s; }
.bubble:nth-child(4) { left: 35%; width: 120px; height: 120px; animation-duration: 15s; animation-delay: 0.8s; }
.bubble:nth-child(5) { left: 45%; width: 80px; height: 80px; animation-duration: 10s; animation-delay: 3.1s; }
.bubble:nth-child(6) { left: 55%; width: 150px; height: 150px; animation-duration: 18s; animation-delay: 1.8s; }
.bubble:nth-child(7) { left: 65%; width: 50px; height: 50px; animation-duration: 9s; animation-delay: 4.2s; }
.bubble:nth-child(8) { left: 75%; width: 90px; height: 90px; animation-duration: 13s; animation-delay: 2.7s; }
.bubble:nth-child(9) { left: 85%; width: 110px; height: 110px; animation-duration: 11s; animation-delay: 5s; }
.bubble:nth-child(10) { left: 92%; width: 70px; height: 70px; animation-duration: 10s; animation-delay: 1.1s; }
.bubble:nth-child(11) { left: 10%; width: 130px; height: 130px; animation-duration: 16s; animation-delay: 3.8s; }
.bubble:nth-child(12) { left: 30%; width: 55px; height: 55px; animation-duration: 9s; animation-delay: 5.6s; }
.bubble:nth-child(13) { left: 50%; width: 95px; height: 95px; animation-duration: 14s; animation-delay: 2s; }
.bubble:nth-child(14) { left: 70%; width: 45px; height: 45px; animation-duration: 8s; animation-delay: 4.8s; }
.bubble:nth-child(15) { left: 80%; width: 140px; height: 140px; animation-duration: 20s; animation-delay: 6.2s; }

.login-card {
    width: min(100%, 420px);
    padding: 42px;
    border-radius: 24px;
    border: 1px solid rgba(120, 145, 180, 0.18);
    background: var(--bg-panel);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    overflow: visible;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    padding: 1px;
    background:
        linear-gradient(180deg, rgba(147, 197, 253, 0.08), rgba(59, 130, 246, 0.015) 35%, rgba(96, 165, 250, 0.04) 68%, rgba(147, 197, 253, 0.06));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

.login-card::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top center, rgba(147, 197, 253, 0.025), transparent 42%),
        radial-gradient(circle at bottom center, rgba(59, 130, 246, 0.02), transparent 46%);
    filter: blur(14px);
    opacity: 0.42;
    pointer-events: none;
    z-index: -1;
}

.logo {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: contain;
    margin: 0 auto 12px;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.16)) drop-shadow(0 0 18px rgba(37, 99, 235, 0.1));
}

.hero-copy {
    margin-bottom: 28px;
    text-align: center;
}

h1 {
    font-size: 1.6rem;
    line-height: 1.15;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
    min-height: 1.85rem;
}

.subtitle {
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 290px;
    margin: 0 auto;
}

.auth-switch {
    --switch-index: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0 0 10px;
    margin-bottom: 20px;
    position: relative;
    isolation: isolate;
    border-radius: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: none;
}

.auth-switch-indicator {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 50%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2f6ff0 0%, #4a8cff 100%);
    box-shadow: 0 0 10px rgba(74, 140, 255, 0.5);
    transform: translateX(calc(var(--switch-index) * 100%));
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 300ms ease, background 300ms ease;
    z-index: 0;
}

.auth-switch-btn {
    position: relative;
    z-index: 1;
    border: 0;
    border-radius: 0;
    padding: 0 10px 8px;
    background: transparent;
    color: rgba(203, 213, 225, 0.58);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-align: center;
    cursor: pointer;
    transition: color 300ms ease, transform 180ms ease, opacity 300ms ease;
}

.auth-switch-btn.is-active {
    color: #f8fbff;
}

.auth-switch-btn:not(.is-active):hover {
    color: rgba(226, 232, 240, 0.78);
}

.auth-switch-btn:active {
    transform: scale(0.985);
}

.auth-switch-btn:focus-visible {
    outline: none;
}

.auth-panel {
    display: none;
}

.auth-panel.is-active {
    display: block;
}

.panel-description {
    margin-bottom: 14px;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.45;
    text-align: center;
}

.vendor-flow-card {
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
}

.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.step-index {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 auto;
}

.flow-step strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.flow-step p {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.5;
}

.vendor-token-step {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.token-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
}

.token-modal[hidden] {
    display: none !important;
}

.token-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.56);
}

.token-modal-card {
    position: relative;
    width: min(100%, 420px);
    padding: 22px 18px 18px;
    border-radius: 22px;
    border: 1px solid rgba(120, 145, 180, 0.2);
    background: rgba(18, 31, 50, 0.96);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.36);
    z-index: 1;
}

.token-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(11, 20, 35, 0.88);
    color: var(--text-soft);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.token-modal-content {
    margin-top: 0;
    padding-top: 6px;
    border-top: 0;
}

.notification-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
}

.notification-modal[hidden] {
    display: none !important;
}

.notification-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(10px);
}

.notification-card {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    padding: 26px 24px 22px;
    border-radius: 24px;
    border: 1px solid rgba(118, 140, 178, 0.26);
    background:
        linear-gradient(180deg, rgba(24, 39, 61, 0.98), rgba(16, 28, 45, 0.98));
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.4);
    text-align: center;
}

.notification-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.16), rgba(96, 165, 250, 0.8), rgba(59, 130, 246, 0.16));
}

.notification-card.is-success::before {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(52, 211, 153, 0.8), rgba(16, 185, 129, 0.12));
}

.notification-card.is-error::before {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.14), rgba(248, 113, 113, 0.86), rgba(239, 68, 68, 0.14));
}

.notification-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-soft);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.notification-close:hover {
    color: var(--text-main);
}

.notification-eyebrow {
    margin-bottom: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7ea5e7;
}

.notification-card.is-success .notification-eyebrow {
    color: #6ee7b7;
}

.notification-card.is-error .notification-eyebrow {
    color: #fda4af;
}

.notification-title {
    display: block;
    margin-bottom: 10px;
    font-size: 1.28rem;
    font-weight: 600;
    color: var(--text-main);
}

.notification-text {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.94rem;
    line-height: 1.65;
    white-space: pre-line;
}

.notification-action {
    margin-top: 22px;
    min-width: 140px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(82, 108, 150, 0.42);
    border-radius: 14px;
    background: #18253a;
    color: var(--text-main);
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.notification-action:hover {
    background: #22314a;
    border-color: rgba(112, 144, 195, 0.5);
    transform: translateY(-1px);
}

.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input::placeholder {
    color: #64748b;
}

.input-group input:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 12px;
    color: var(--text-soft);
    font-size: 0.88rem;
    cursor: pointer;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.btn-entrar,
.btn-secondary-action {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-entrar {
    border: 1px solid var(--accent-strong);
    background: linear-gradient(180deg, #3a78f1 0%, #2563eb 55%, #1f55d8 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.26), 0 2px 8px rgba(15, 23, 42, 0.14);
}

.btn-secondary-action {
    border: 1px solid rgba(37, 99, 235, 0.55);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.9));
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(29, 78, 216, 0.22);
}

.btn-entrar:hover,
.btn-secondary-action:hover {
    transform: translateY(-1px);
}

.btn-entrar:disabled,
.btn-secondary-action:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #64748b;
    border-top-color: #ffffff;
    animation: spin 0.7s linear infinite;
    display: none;
}

.is-loading .btn-spinner {
    display: inline-block;
}

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

.message-area {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: left;
    display: none;
}

.message-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.message-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.powered {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 18px;
    text-align: center;
    font-size: 0.72rem;
    color: #64748b;
    z-index: 1;
}

@media (max-width: 560px) {
    body {
        padding: 16px 12px 52px;
        overflow: auto;
    }

    .login-card {
        width: 100%;
        padding: 28px 22px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .powered {
        bottom: 12px;
    }
}
