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

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

html {
scroll-behavior: smooth;
}

body {
min-height: 100vh;
padding: 0 16px 50px;

font-family: "Inter", sans-serif;
color: #f8fafc;

background:
    radial-gradient(
        circle at 10% 0%,
        rgba(56, 189, 248, 0.14),
        transparent 32%
    ),
    radial-gradient(
        circle at 90% 100%,
        rgba(37, 99, 235, 0.14),
        transparent 32%
    ),
    #0f172a;

}

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

.titulo {
width: min(900px, 100%);
margin: 0 auto;
padding: 34px 0 24px;

text-align: center;

}

.titulo h1 {
color: #7dd3fc;

font-size: 30px;
font-weight: 700;
letter-spacing: 1.5px;

}

.titulo p {
margin-top: 8px;

color: #94a3b8;

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

}

/* =========================
CONTEÚDO PRINCIPAL
========================= */

main {
width: min(900px, 100%);
margin: 0 auto;
}

/* =========================
FERRAMENTA PRINCIPAL
========================= */

.color-tool {
display: grid;
grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
gap: 24px;

padding: 24px;

background:
    radial-gradient(
        circle at top right,
        rgba(56, 189, 248, 0.12),
        transparent 45%
    ),
    linear-gradient(
        145deg,
        rgba(23, 37, 84, 0.95),
        rgba(15, 23, 42, 0.98)
    );

border: 1px solid rgba(148, 163, 184, 0.14);
border-radius: 22px;

box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.25);

}

/* =========================
SELETOR DE COR
========================= */

.color-picker {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

min-width: 0;

}

.canvas-wrapper {
position: relative;

width: min(300px, 100%);
aspect-ratio: 1;

}

.colorWheel {
display: block;

width: 100%;
height: 100%;

border-radius: 50%;

cursor: crosshair;

touch-action: none;

border: 2px solid rgba(255, 255, 255, 0.12);

box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.35),
    0 0 35px rgba(56, 189, 248, 0.08);

}

.color-picker-cursor {
position: absolute;

width: 18px;
height: 18px;

transform: translate(-50%, -50%);

border: 3px solid #ffffff;
border-radius: 50%;

box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.85),
    0 3px 10px rgba(0, 0, 0, 0.45);

pointer-events: none;

}

.lightness {
width: min(300px, 100%);
height: 8px;

margin-top: 22px;

appearance: none;
-webkit-appearance: none;

border-radius: 999px;

outline: none;

background:
    linear-gradient(
        to right,
        #020617,
        #64748b,
        #ffffff
    );

cursor: pointer;

}

.lightness::-webkit-slider-thumb {
width: 18px;
height: 18px;

appearance: none;
-webkit-appearance: none;

border: 3px solid #ffffff;
border-radius: 50%;

background: #2563eb;

box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4);

cursor: pointer;

}

.lightness::-moz-range-thumb {
width: 18px;
height: 18px;

border: 3px solid #ffffff;
border-radius: 50%;

background: #2563eb;

box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4);

cursor: pointer;

}

/* =========================
INFORMAÇÕES DA COR
========================= */

.color-info {
display: flex;
flex-direction: column;
justify-content: center;

min-width: 0;

}

/* =========================
PREVIEW
========================= */

.color-preview {
display: flex;
align-items: center;
gap: 14px;

margin-bottom: 22px;

}

.amostra {
width: 58px;
height: 58px;

flex-shrink: 0;

border: 2px solid rgba(255, 255, 255, 0.16);
border-radius: 14px;

background: #3b82f6;

box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.25);

}

.preview-label {
display: block;

margin-bottom: 5px;

color: #94a3b8;

font-size: 12px;

}

.preview-hex {
color: #e0f2fe;

font-family: monospace;
font-size: 18px;

}

/* =========================
VALORES
========================= */

.color-values {
display: flex;
flex-direction: column;
gap: 12px;
}

.color-value > span {
display: block;

margin-bottom: 6px;

color: #94a3b8;

font-size: 11px;
font-weight: 600;
letter-spacing: 1px;

}

.value-row {
display: flex;
gap: 8px;

min-width: 0;

}

.value-row input {
width: 100%;
min-width: 0;
height: 42px;

padding: 0 12px;

border: 1px solid rgba(125, 211, 252, 0.15);
border-radius: 10px;

outline: none;

background: rgba(2, 6, 23, 0.55);

color: #7dd3fc;

font-family: monospace;
font-size: 13px;

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

}

.value-row input:focus {
border-color: rgba(56, 189, 248, 0.65);

background: rgba(56, 189, 248, 0.06);

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

}

.copiar {
flex-shrink: 0;

height: 42px;

padding: 0 13px;

border: 1px solid rgba(148, 163, 184, 0.16);
border-radius: 10px;

background: rgba(30, 41, 59, 0.8);

color: #cbd5e1;

font-family: "Inter", sans-serif;
font-size: 12px;
font-weight: 600;

cursor: pointer;

transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;

}

.copiar:hover {
border-color: rgba(56, 189, 248, 0.45);

background: rgba(56, 189, 248, 0.1);

transform: translateY(-1px);

}

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

background: rgba(74, 222, 128, 0.1);

color: #86efac;

}

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

.color-actions {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;

margin-top: 20px;

}

.btn-color,
.btn-adicionar {
min-height: 42px;

padding: 0 16px;

border: 1px solid rgba(56, 189, 248, 0.2);
border-radius: 10px;

background: rgba(37, 99, 235, 0.14);

color: #bae6fd;

font-family: "Inter", sans-serif;
font-size: 13px;
font-weight: 600;

cursor: pointer;

transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;

}

.btn-color:hover,
.btn-adicionar:hover {
border-color: rgba(56, 189, 248, 0.5);

background: rgba(37, 99, 235, 0.25);

transform: translateY(-1px);

}

.btn-limpar {
background: rgba(30, 41, 59, 0.65);

color: #cbd5e1;

border-color: rgba(148, 163, 184, 0.16);

}

/* =========================
PALETA
========================= */

.palette {
margin-top: 24px;
padding: 22px 24px;

background:
    linear-gradient(
        145deg,
        rgba(23, 37, 84, 0.85),
        rgba(15, 23, 42, 0.95)
    );

border: 1px solid rgba(148, 163, 184, 0.14);
border-radius: 20px;

box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.2);

}

.palette-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 15px;

margin-bottom: 18px;

}

.palette-header h2 {
color: #e0f2fe;

font-size: 18px;

}

.palette-header p {
margin-top: 5px;

color: #64748b;

font-size: 12px;

}

.btn-adicionar {
min-height: 38px;

padding: 0 14px;

white-space: nowrap;

}

/* =========================
CORES SALVAS
========================= */

.palette-list {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}

.palette-color {
display: flex;
align-items: center;
gap: 10px;

min-width: 0;
min-height: 52px;

padding: 8px;

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

background: rgba(2, 6, 23, 0.38);

}

.palette-swatch {
width: 36px;
height: 36px;

flex-shrink: 0;

border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 8px;

}

.palette-color span {
min-width: 0;

overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

color: #cbd5e1;

font-family: monospace;
font-size: 12px;

}

.palette-color button {
margin-left: auto;

flex-shrink: 0;

padding: 7px 9px;

border: 1px solid rgba(148, 163, 184, 0.14);
border-radius: 8px;

background: rgba(30, 41, 59, 0.8);

color: #94a3b8;

font-family: "Inter", sans-serif;
font-size: 11px;

cursor: pointer;

transition: 0.2s ease;

}

.palette-color button:hover {
border-color: rgba(56, 189, 248, 0.4);

color: #7dd3fc;

background: rgba(56, 189, 248, 0.08);

}

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

button:focus-visible,
input:focus-visible,
.colorWheel:focus-visible {
outline: 2px solid #38bdf8;
outline-offset: 3px;
}

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

@media (max-width: 700px) {

body {
    padding: 0 12px 40px;
}

.titulo {
    padding-top: 26px;
}

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

.color-tool {
    grid-template-columns: 1fr;

    padding: 20px;
}

.color-picker {
    width: min(360px, 100%);
    margin: 0 auto;
}

.color-info {
    width: 100%;
}

}

@media (max-width: 500px) {

.titulo {
    padding: 22px 0 18px;
}

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

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

.color-tool {
    padding: 16px;

    border-radius: 18px;
}

.canvas-wrapper {
    width: min(300px, 86vw);
}

.lightness {
    width: min(300px, 86vw);
}

.color-preview {
    margin-bottom: 18px;
}

.amostra {
    width: 52px;
    height: 52px;
}

.preview-hex {
    font-size: 16px;
}

.value-row input {
    height: 40px;

    font-size: 12px;
}

.copiar {
    height: 40px;

    padding: 0 10px;
}

.color-actions {
    grid-template-columns: 1fr;
}

.palette {
    padding: 18px 16px;

    border-radius: 18px;
}

.palette-header {
    align-items: flex-start;
}

.palette-list {
    grid-template-columns: 1fr;
}

}

@media (max-width: 360px) {

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

.color-tool {
    padding: 13px;
}

.value-row {
    flex-direction: column;
}

.value-row input,
.copiar {
    width: 100%;
}

.palette-header {
    flex-direction: column;
}

.btn-adicionar {
    width: 100%;
}

}