*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --bg-dark:          #0a0c15;
    --bg-surface:       #11131e;
    --bg-card:          #161a27;
    --border:           #1f2538;
    --border-light:     #2a3148;
    --surface:          #11121a;
    --lime:             #8ec127;
    --lime-dark:        #7fad23;
    --text-primary:     #f0f2f5;
    --text-secondary:   #9ca3af;
    --text-muted:       #6b7280;
    --shadow-sm:     0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md:     0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg:     0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl:     0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

html, body {
    height: 100%;
}
body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}
.bg-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
    animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    50% { transform: translate(-2%, -1%) scale(1.05); opacity: 0.7; }
}
.wrapper {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    flex: 1;
    width: 100%;
}
/* Hero */
.hero {
    text-align: center;
    margin-top: 60px;
    margin-bottom: 48px;
}
.tag {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--lime);
    background: rgba(212, 175, 55, 0.1);
    padding: 6px 14px;
    border-radius: 40px;
    margin-bottom: 24px;
    text-transform: uppercase;
}
.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(40px, 8vw, 70px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
}
.hero h1 em {
    color: var(--lime);
    font-style: normal;
}
.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 36px;
    transition: all 0.3s ease;
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}
.tab {
    background: transparent;
    border: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 40px;
}

.tab.active {
    color: var(--lime);
    background: rgba(212, 175, 55, 0.1);
}

.tab:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

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

.code-label {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-family: 'IBM Plex Mono', monospace;
}
.code-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}
.code-input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 60px;
    padding: 14px 24px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s;
    outline: none;
}
.code-input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}
.btn-validar {
    background: var(--lime);
    color: var(--bg-dark);
    border: none;
    border-radius: 60px;
    padding: 14px 32px;
    font-weight: 600;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-validar:hover {
    background: var(--lime-dark);
    box-shadow: 0 8px 24px rgba(142, 193, 39, 0.25);
    gap: 12px;
}

.btn-validar.loading {
    background: var(--accent);
    background-image: url('../img/spinner.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 24px 24px;
    color: transparent;
    pointer-events: none;
    cursor: wait;
}

footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 32px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'IBM Plex Mono', monospace;
    margin-top: 40px;
}
@media (max-width: 768px) {
    .wrapper {
        padding: 0 20px;
    }
    .hero {
        margin-top: 40px;
    }
    .card {
        padding: 28px 24px;
    }
    .hero h1 {
        font-size: 40px;
    }
    .code-row {
        flex-direction: column;
    }
    .btn-validar {
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .hero h1 {
        font-size: 32px;
    }
    .card {
        padding: 24px 20px;
    }
}

/* ── RESULTADO DA VALIDAÇÃO ── */
.result {
    display: none;
    margin-top: 32px;
    padding: 0;
    animation: fadeIn 0.4s ease;
}

.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--lime) 0%, var(--lime-dark) 100%);
}

.result-card h3 {
    font-family: Georgia, serif;
    font-weight: bold;

    font-size: 24px;
    font-weight: 700;
    color: var(--lime);
    margin-bottom: 20px;
}

.result-message {
    background: rgba(212, 175, 55, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
    border-left: 3px solid var(--lime);
}

.result-message strong {
    color: var(--lime);
    font-weight: 600;
}

.badge-valid {
    display: inline-block;
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .result-card {
        padding: 20px;
    }
    
    .result-card h3 {
        font-size: 20px;
    }
}

/* ── MENSAGEM ALERTE ── */
.toast-message {
    z-index: 999999 !important;
    position: fixed;
    bottom: 30px;
    right: 30px;
    max-width: 90vw; 
    width: auto;
    min-width: 400px; 
    white-space: pre-wrap; 
    word-wrap: break-word; 
    padding: 20px 30px 20px 60px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 15px;
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    animation: toast-in 0.4s ease forwards;
    background-repeat: no-repeat;
    background-position: 20px center;
    background-size: 25px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
    margin: 0;
}

/* Remove o backdrop padrão do dialog */
.toast-message::backdrop {
    background: transparent;
}

/* Ajusta o posicionamento quando o dialog está aberto */
.toast-message[open] {
    display: flex;
    position: fixed;
    inset: auto;
    bottom: 30px;
    right: 30px;
}

.toast-message::after {
    content: "×";
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    font-weight: bold;
    opacity: 0.7;
    pointer-events: none;
}
.toast-message::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 5px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    animation: toast-bar 3s forwards;
}
.toast-success {
    background-color: #28a745;
    background-image: url('../img/alert-success.svg');
}
.toast-error {
    background-color: #cb0606;
    background-image: url('../img/alert-error.svg');
}
.toast-info {
    background-color: #0d6efd;
    background-image: url('../img/alert-info.svg');
}
.toast-warning {
    background-color: #503d2f;
    background-image: url('../img/alert-warning.svg');
}
@keyframes toast-bar {
    0% {
      width: 0;
    }
    100% {
      width: 100%;
    }
}
@keyframes toast-in {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes toast-out {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .toast-message {
        bottom: auto;   
        top: 20px;
        right: 20px;
        left: 20px; 
        width: calc(100% - 40px); 
        min-width: auto; 
        max-width: calc(100% - 40px);
    }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--lime-dark); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--lime); }