/* =========================================================
   RESET
========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    font-family: "Inter", sans-serif;

    color: #e2e8f0;

    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(37, 99, 235, 0.22),
            transparent 32%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(14, 165, 233, 0.14),
            transparent 32%
        ),
        linear-gradient(
            180deg,
            #08111f 0%,
            #0b1424 50%,
            #080f1c 100%
        );
}


/* =========================================================
   PÁGINA
========================================================= */

main {
    width: min(980px, 94%);
    margin: 0 auto;
    padding: 10px 0 60px;
}


/* =========================================================
   CABEÇALHO
========================================================= */

.titulo {
    width: min(980px, 94%);
    margin: 0 auto;

    padding: 48px 0 28px;

    text-align: center;
}

.titulo h1 {
    color: #f8fafc;

    font-size: clamp(
        28px,
        5vw,
        40px
    );

    font-weight: 700;

    letter-spacing: -1.2px;
}

.titulo h1::after {
    content: "";

    display: block;

    width: 54px;
    height: 3px;

    margin: 14px auto 0;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #38bdf8
        );
}

.titulo p {
    max-width: 560px;

    margin: 14px auto 0;

    color: #94a3b8;

    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   ÁREAS PRINCIPAIS
========================================================= */

.entrada,
.resultado {
    width: 100%;

    padding: 22px;

    border: 1px solid
        rgba(148, 163, 184, 0.12);

    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.92),
            rgba(8, 17, 31, 0.88)
        );

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.22);

    backdrop-filter: blur(12px);
}

.resultado {
    margin-top: 18px;
}


/* =========================================================
   LABELS
========================================================= */

.entrada > label,
.resultado-topo label {
    display: block;

    margin-bottom: 10px;

    color: #cbd5e1;

    font-size: 13px;
    font-weight: 600;

    letter-spacing: 0.2px;
}


/* =========================================================
   CAMPO DE ENTRADA
========================================================= */

.json-input {
    display: block;

    width: 100%;
    min-height: 270px;

    padding: 17px;

    border: 1px solid
        rgba(96, 165, 250, 0.16);

    border-radius: 13px;

    outline: none;

    background:
        #060d18;

    color: #e2e8f0;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 13px;
    line-height: 1.65;

    resize: vertical;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.json-input:hover {
    border-color:
        rgba(96, 165, 250, 0.25);
}

.json-input:focus {
    border-color:
        rgba(56, 189, 248, 0.7);

    background:
        #07111f;

    box-shadow:
        0 0 0 3px
        rgba(56, 189, 248, 0.08);
}

.json-input::placeholder {
    color: #475569;
}


/* =========================================================
   ÁREA DE BOTÕES PRINCIPAIS
========================================================= */

.botoes-json {
    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 9px;

    margin-top: 13px;
}


/* =========================================================
   BOTÃO BASE
========================================================= */

.btn-json {
    min-height: 42px;

    padding: 9px 13px;

    border: 1px solid
        rgba(96, 165, 250, 0.18);

    border-radius: 10px;

    outline: none;

    background:
        #111e33;

    color: #cbd5e1;

    font-family: "Inter", sans-serif;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.16s ease,
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease;
}

.btn-json:hover {
    transform: translateY(-1px);

    border-color:
        rgba(96, 165, 250, 0.45);

    background:
        #172943;

    color: #f8fafc;
}

.btn-json:active {
    transform: translateY(0);
}

.btn-json:focus-visible {
    border-color: #38bdf8;

    box-shadow:
        0 0 0 3px
        rgba(56, 189, 248, 0.1);
}


/* =========================================================
   AÇÕES PRINCIPAIS
========================================================= */

.btn-formatar {
    background:
        linear-gradient(
            135deg,
            #2563eb,
            #1d4ed8
        );

    border-color:
        rgba(96, 165, 250, 0.5);

    color: #fff;
}

.btn-formatar:hover {
    background:
        linear-gradient(
            135deg,
            #3b82f6,
            #2563eb
        );
}

.btn-minificar,
.btn-validar {
    color: #bfdbfe;
}


/* =========================================================
   TOPO DO RESULTADO
========================================================= */

.resultado-topo {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;
}

.resultado-topo label {
    margin-bottom: 0;
}


/* =========================================================
   STATUS
========================================================= */

.json-status {
    min-height: 18px;

    color: #64748b;

    font-size: 11px;
    font-weight: 500;

    text-align: right;
}

.json-status.sucesso {
    color: #4ade80;
}

.json-status.erro {
    color: #f87171;
}


/* =========================================================
   RESULTADO
========================================================= */

.json-result {
    width: 100%;
    min-height: 270px;

    padding: 17px;

    border: 1px solid
        rgba(96, 165, 250, 0.14);

    border-radius: 13px;

    background:
        #060d18;

    color: #93c5fd;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 13px;
    line-height: 1.65;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    overflow: auto;

    scrollbar-width: thin;
}


/* =========================================================
   BOTÕES DO RESULTADO
========================================================= */

.botoes-resultado {
    display: flex;

    gap: 9px;

    margin-top: 13px;
}

.botoes-resultado .btn-json {
    flex: 1;
}


/* =========================================================
   BOTÃO COPIADO
========================================================= */

.btn-copiar.copiado {
    border-color:
        rgba(74, 222, 128, 0.4);

    background:
        rgba(22, 101, 52, 0.3);

    color: #86efac;
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #07101d;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background: #1e3a5f;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}


/* =========================================================
   SELEÇÃO
========================================================= */

::selection {
    background:
        rgba(37, 99, 235, 0.35);

    color: #fff;
}


/* =========================================================
   RESPONSIVIDADE — TABLET
========================================================= */

@media (max-width: 760px) {

    .titulo {
        padding-top: 36px;
    }

    .botoes-json {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .botoes-json .btn-formatar {
        grid-column: span 2;
    }
}


/* =========================================================
   RESPONSIVIDADE — CELULAR
========================================================= */

@media (max-width: 520px) {

    main {
        width: 94%;

        padding-bottom: 35px;
    }

    .titulo {
        width: 94%;

        padding:
            30px 0 22px;
    }

    .titulo h1 {
        font-size: 27px;
    }

    .titulo p {
        font-size: 13px;
    }

    .entrada,
    .resultado {
        padding: 15px;

        border-radius: 15px;
    }

    .json-input,
    .json-result {
        min-height: 230px;

        padding: 14px;

        font-size: 12px;
    }

    .botoes-json {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 7px;
    }

    .botoes-json .btn-formatar {
        grid-column: span 2;
    }

    .btn-json {
        min-height: 40px;

        padding: 8px;

        font-size: 11px;
    }

    .botoes-resultado {
        display: grid;

        grid-template-columns:
            repeat(2, 1fr);
    }

    .botoes-resultado .btn-json {
        width: 100%;
    }

    .botoes-resultado .btn-limpar {
        grid-column: span 2;
    }

    .resultado-topo {
        align-items: flex-start;
        flex-direction: column;

        gap: 5px;
    }

    .json-status {
        text-align: left;
    }
}


/* =========================================================
   CELULARES PEQUENOS
========================================================= */

@media (max-width: 360px) {

    .titulo h1 {
        font-size: 24px;
    }

    .entrada,
    .resultado {
        padding: 12px;
    }

    .botoes-json,
    .botoes-resultado {
        grid-template-columns: 1fr;
    }

    .botoes-json .btn-formatar,
    .botoes-resultado .btn-limpar {
        grid-column: span 1;
    }
}