/* ==========================================
   CONFIGURAÇÕES GERAIS
========================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #0b0d14;
    color: #f8fafc;
    font: 14px system-ui, Arial, sans-serif;
    display: grid;
    place-items: center;
    padding: 24px;
}

/* ==========================================
   PAINEL PRINCIPAL - ESTILO ORIGINAL
========================================== */

.card {
    width: min(460px, 100%);
    background: #181b27;
    border: 1px solid #2c334a;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 12px 30px #0003;
}

h1 {
    text-align: center;
    font-size: 24px;
    margin: 10px 0;
}

p {
    text-align: center;
    color: #b8c3d9;
    line-height: 1.5;
    margin-bottom: 30px;
}

/* ==========================================
   FORMULÁRIOS
========================================== */

label {
    display: block;
    color: #b9c9e7;
    font-size: 13px;
    margin: 20px 0;
}

input {
    display: block;
    width: 100%;
    margin-top: 9px;
    padding: 15px 12px;
    border-radius: 8px;
    border: 1px solid #303a52;
    background: #0d1019;
    color: white;
    font: inherit;
}

textarea {
    display: block;
    width: 100%;
    min-height: 125px;
    background: #0d1019;
    color: white;
    border: 1px solid #303a52;
    border-radius: 8px;
    padding: 12px;
    font: inherit;
}

/* ==========================================
   BOTÕES
========================================== */

button {
    width: 100%;
    padding: 16px;
    border: 0;
    border-radius: 8px;
    background: #5047e5;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #655df1;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================
   RESULTADO DO RESGATE
========================================== */

#result,
.message {
    margin-top: 18px;
    text-align: center;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* ==========================================
   CONTEÚDO DA LICENÇA
========================================== */

.serial {
    background: #0d1019;
    padding: 24px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.8;

    /* Preserva as quebras de linha */
    white-space: pre-wrap;

    /* Evita que o texto saia da caixa */
    overflow-wrap: anywhere;

    /* Alinha as instruções à esquerda */
    text-align: left;

    /* Permite selecionar e copiar */
    user-select: text;

    margin: 16px 0;
}

/* ==========================================
   TEXTOS AUXILIARES
========================================== */

.small {
    font-size: 12px;
    color: #a9b4cd;
}

a {
    color: #a7a1ff;
}

hr {
    border: 0;
    border-top: 1px solid #303a52;
    margin: 26px 0;
}

/* ==========================================
   RESPONSIVIDADE GERAL
========================================== */

@media (max-width: 600px) {

    body {
        padding: 12px;
    }

    .card {
        padding: 20px;
    }

    h1 {
        font-size: 22px;
    }

    .serial {
        padding: 16px;
        font-size: 14px;
        line-height: 1.7;
    }
}

/* ==========================================
   RESGATE DE LICENÇA 2.0
   VISUAL MODERNO E TECNOLÓGICO

   Os estilos abaixo afetam somente
   a página com body.resgate-page.
========================================== */

/* FUNDO TECNOLÓGICO */

body.resgate-page {
    background:
        radial-gradient(
            ellipse at 15% 15%,
            rgba(110, 55, 255, 0.22),
            transparent 45%
        ),
        radial-gradient(
            ellipse at 85% 85%,
            rgba(65, 35, 180, 0.18),
            transparent 45%
        ),
        #080a12;

    font-family: Inter, system-ui, Arial, sans-serif;
}

/* CARTÃO PRINCIPAL */

.resgate-page .card {
    width: min(520px, 100%);
    background: rgba(20, 22, 38, 0.88);

    border: 1px solid rgba(155, 120, 255, 0.25);

    border-radius: 24px;
    padding: 38px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.45),
        0 0 60px rgba(105, 65, 255, 0.08);

    backdrop-filter: blur(18px);
}

/* ÍCONE SUPERIOR */

.resgate-page .license-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 20px;

    display: grid;
    place-items: center;

    border-radius: 18px;

    background: linear-gradient(
        135deg,
        #8955ff,
        #4f36dc
    );

    box-shadow:
        0 10px 30px rgba(118, 75, 255, 0.3);

    font-size: 30px;
}

/* TÍTULO */

.resgate-page h1 {
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -0.7px;
    margin-bottom: 12px;
}

/* SUBTÍTULO */

.resgate-page .subtitle {
    color: #aeb5ce;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 28px;
}

/* ==========================================
   INDICADOR DE ETAPAS
========================================== */

.resgate-page .steps {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 8px;
    margin-bottom: 30px;

    font-size: 11px;
    color: #9ba3be;
}

.resgate-page .step {
    padding: 8px 10px;

    border-radius: 20px;

    background: rgba(255, 255, 255, 0.04);

    border: 1px solid rgba(255, 255, 255, 0.07);

    white-space: nowrap;
}

.resgate-page .step.active {
    background: rgba(125, 80, 255, 0.18);

    color: #c5b3ff;

    border-color: rgba(150, 105, 255, 0.4);
}

/* ==========================================
   CAMPOS DO FORMULÁRIO
========================================== */

.resgate-page label {
    font-size: 13px;
    font-weight: 500;
    color: #cbd2e7;
}

.resgate-page input {
    background: #101322;

    border: 1px solid #343750;

    border-radius: 12px;

    padding: 16px;

    color: #ffffff;

    transition:
        border-color 0.25s,
        box-shadow 0.25s;
}

/* TEXTO DOS CAMPOS */

.resgate-page input::placeholder {
    color: #747b97;
}

/* EFEITO AO SELECIONAR CAMPO */

.resgate-page input:focus {
    outline: none;

    border-color: #986bff;

    box-shadow:
        0 0 0 3px rgba(135, 80, 255, 0.15);
}

/* ==========================================
   BOTÃO DE RESGATE
========================================== */

.resgate-page button[type="submit"] {
    margin-top: 12px;

    padding: 18px;

    border-radius: 12px;

    background: linear-gradient(
        135deg,
        #9255ff,
        #5738df
    );

    box-shadow:
        0 10px 30px rgba(110, 65, 255, 0.25);

    font-size: 14px;

    letter-spacing: 0.4px;

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

/* EFEITO AO PASSAR O MOUSE */

.resgate-page button[type="submit"]:hover {
    transform: translateY(-2px);

    box-shadow:
        0 15px 35px rgba(110, 65, 255, 0.4);
}

/* BOTÃO DESATIVADO */

.resgate-page button[type="submit"]:disabled {
    transform: none;
    cursor: wait;
}

/* ==========================================
   RESULTADO DO RESGATE
========================================== */

.resgate-page #result {
    margin-top: 24px;
    line-height: 1.7;
}

/* CAIXA COM AS INSTRUÇÕES */

.resgate-page .serial {
    background: #101322;

    border: 1px solid #343750;

    border-radius: 14px;

    padding: 24px;

    font-size: 14px;

    line-height: 1.8;

    text-align: left;

    /* Mantém os parágrafos originais */
    white-space: pre-wrap;

    /* Evita textos ultrapassando a caixa */
    overflow-wrap: anywhere;

    user-select: text;

    margin: 20px 0;
}

/* ==========================================
   ÁREA DE SUPORTE
========================================== */

.resgate-page .support {
    text-align: center;

    color: #8f98b4;

    font-size: 12px;

    margin-top: 30px;

    line-height: 1.6;
}

/* ==========================================
   RESPONSIVIDADE PARA CELULARES
========================================== */

@media (max-width: 600px) {

    .resgate-page .card {
        padding: 26px 20px;
        border-radius: 18px;
    }

    .resgate-page h1 {
        font-size: 25px;
    }

    .resgate-page .steps {
        gap: 5px;
        font-size: 10px;
    }

    .resgate-page .step {
        padding: 7px;
    }

    .resgate-page .serial {
        padding: 16px;
        font-size: 13px;
    }
}

/* ==========================================
   ACESSIBILIDADE
========================================== */

@media (prefers-reduced-motion: reduce) {

    .resgate-page button[type="submit"],
    .resgate-page input {
        transition: none;
    }
}

/* ==========================================
   TELA DE RESGATE CONCLUÍDO
========================================== */

.resgate-page .resgate-success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 16px;
    padding: 26px 20px;
    text-align: center;
    margin: 20px 0;
}

.resgate-page .success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    font-size: 34px;
    font-weight: bold;
}

.resgate-page .resgate-success h2 {
    color: #4ade80;
    font-size: 23px;
    margin: 10px 0;
}

.resgate-page .resgate-success p {
    color: #b9c9e7;
    font-size: 13px;
    margin: 10px 0 0;
}

.resgate-page .license-title {
    color: #e5dcff;
    text-align: left;
    font-size: 16px;
    margin: 26px 0 12px;
}

.resgate-page .copy-button {
    margin-top: 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #9255ff, #5738df);
    padding: 17px;
    font-size: 13px;
    letter-spacing: 0.4px;
}

.resgate-page .copy-button:hover {
    background: linear-gradient(135deg, #a477ff, #694ef0);
}

.resgate-page .resgate-message {
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
}

.resgate-page .resgate-message.loading {
    background: rgba(125, 80, 255, 0.1);
    border: 1px solid rgba(150, 105, 255, 0.3);
    color: #c5b3ff;
}

.resgate-page .resgate-message.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Mantém o formulário oculto após o resgate */
.resgate-page #form[hidden] {
    display: none;
}