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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: #17140F;
    color: #F5F1EA;
    padding: 30px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

p.etiqueta {
    color: #BA7517;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: center;
    animation: entrar 0.6s ease-out both;
}

h1 {
    font-size: clamp(28px, 6vw, 52px);
    font-weight: 800;
    color: #F5F1EA;
    line-height: 1.25;
    margin-bottom: 8px;
    text-align: center;
    animation: entrar 0.6s ease-out 0.1s both;
}

span {
    color: #D9A441;
}

p.subtitulo {
    color: #8f887a;
    margin-top: 16px;
    font-size: clamp(14px, 2.5vw, 18px);
    text-align: center;
    max-width: 90%;
    animation: entrar 0.6s ease-out 0.2s both;
}

.robo {
    display: inline-block;
    animation: flutuar 2.4s ease-in-out infinite;
}

.estilos {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.estilos-label {
    color: #8f887a;
    font-size: 13px;
}

.chip-estilo {
    background: #211D17;
    border: 1px solid #3a3226;
    color: #c9c2b4;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.chip-estilo:hover {
    border-color: #BA7517;
}

.chip-estilo.ativo {
    background: #BA7517;
    color: #412402;
    border-color: #BA7517;
    font-weight: 600;
}

.caixa-entrada {
    width: 100%;
    max-width: 620px;
    background: #211D17;
    border-radius: 16px;
    padding: 12px;
    margin-top: 16px;
    display: flex;
    border: 1px solid #3a3226;
    transition: border-color 0.2s ease;
    animation: entrar 0.6s ease-out 0.3s both;
}

.caixa-entrada:focus-within {
    border-color: #BA7517;
}

.campo-texto {
    position: relative;
    width: 80%;
}

textarea {
   width: 100%;
   resize: none;
   outline: none;
   background: transparent;
   padding: 8px 8px 18px 8px;
   color: #F5F1EA;
   font-size: 15px;
   border: none;
}

textarea::placeholder {
    color: #6b6357;
}

.contador {
    position: absolute;
    right: 8px;
    bottom: 2px;
    font-size: 11px;
    color: #6b6357;
}

button {
    width: 20%;
    min-width: 100px;
    padding: 10px 16px;
    color: #412402;
    background: #BA7517;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.1s ease;
}

button:hover:not(:disabled) {
    background: #D9A441;
}

button:active:not(:disabled) {
    transform: scale(0.97);
}

button:disabled {
    background: #3a3226;
    color: #8f887a;
    cursor: not-allowed;
}

.ponto {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-left: 3px;
    animation: pulsar 1.2s infinite;
}

.ponto:nth-child(2) { animation-delay: 0.15s; }
.ponto:nth-child(3) { animation-delay: 0.3s; }

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

@keyframes pulsar {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

@keyframes flutuar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
    p.etiqueta, h1, p.subtitulo, .caixa-entrada, .ponto, .robo {
        animation: none !important;
    }
}

.mensagem-erro {
    width: 100%;
    max-width: 620px;
    margin-top: 12px;
    padding: 10px 14px;
    background: #2a1512;
    border: 1px solid #6b2f1f;
    color: #f0a687;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.historico {
    width: 100%;
    max-width: 620px;
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.historico-item {
    background: #211D17;
    border: 1px solid #3a3226;
    color: #c9c2b4;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto;
    min-width: 0;
    font-weight: 400;
}

.historico-item:hover {
    border-color: #BA7517;
    background: #211D17;
}

.caixa-resultado {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    margin-top: 40px;
    background: #1c1811;
    border-radius: 12px;
    border: 1px solid #3a3226;
    gap: 12px;
}

.acoes-resultado {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acoes-resultado button {
    width: auto;
    background: #211D17;
    border: 1px solid #3a3226;
    color: #F5F1EA;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
}

.acoes-resultado button:hover:not(:disabled) {
    border-color: #BA7517;
    background: #2a251c;
}

.resultado-corpo {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

.bloco-codigo {
    flex: 1 1 280px;
    background: #120f0b;
    padding: 16px;
    font-size: 12px;
    color: #d8cbb9;
    white-space: pre-wrap;
    overflow: auto;
    height: 500px;
    border-radius: 12px;
    border: 1px solid #3a3226;
}

.bloco-site {
    flex: 2 1 320px;
    height: 500px;
    border: 1px solid #3a3226;
    border-radius: 12px;
    background-color: #1e1e1e;
    width: 100%;
}

@media (max-width: 768px) {
    .resultado-corpo {
        gap: 12px;
    }

    .bloco-codigo,
    .bloco-site {
        flex: 1 1 100%;
        height: 400px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 20px 12px;
    }

    .caixa-entrada {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .campo-texto,
    .caixa-entrada > button {
        width: 100%;
    }

    textarea {
        font-size: 16px;
    }

    .bloco-codigo,
    .bloco-site {
        height: 320px;
    }
}

@media (max-width: 380px) {
    p.etiqueta {
        font-size: 13px;
    }

    .bloco-codigo,
    .bloco-site {
        height: 260px;
    }
}
