
/* ==========================================================
   FORMATO CIRCLE - ESTILOS PRINCIPALES
   Diseño responsive, moderno y adaptable
   ========================================================== */

/* ---------- VARIABLES Y TEMAS ---------- */

:root {
    --bg: #eef2f6;
    --card: #ffffff;
    --ink: #12202e;
    --mute: #64748b;
    --line: #d5dde6;

    --pdf: #d64545;
    --word: #2f6fde;
    --excel: #1e9e62;
    --img: #e08a1e;
    --dni: #7a4fd6;
    --otros: #5b6b7a;

    --primary: #2f6fde;
    --success: #1e9e62;
    --danger: #d64545;
    --warning: #e08a1e;

    --radius: 20px;
    --shadow: 0 8px 30px rgba(20, 40, 65, .07);
    --transition: .22s ease;

    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0d1621;
    --card: #16222f;
    --ink: #e8eef5;
    --mute: #92a1b0;
    --line: #26364a;

    --shadow: 0 8px 30px rgba(0, 0, 0, .2);

    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1621;
        --card: #16222f;
        --ink: #e8eef5;
        --mute: #92a1b0;
        --line: #26364a;
        color-scheme: dark;
    }
}

/* ---------- REINICIO GENERAL ---------- */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

body {
    margin: 0;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);

    background: var(--bg);
    color: var(--ink);

    font-family: "Figtree", system-ui, -apple-system,
        "Segoe UI", Roboto, Arial, sans-serif;

    transition:
        background var(--transition),
        color var(--transition);
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

/* ---------- CABECERA ---------- */

header {
    width: 100%;
    max-width: 1200px;
    min-height: 76px;

    margin: 0 auto;
    padding: 14px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

h1 {
    display: flex;
    align-items: center;
    gap: 11px;

    margin: 0;

    font-size: 1.35rem;
    font-weight: 850;
    letter-spacing: -.7px;
}

.logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;

    background: conic-gradient(
        var(--pdf) 0deg 60deg,
        var(--word) 60deg 120deg,
        var(--excel) 120deg 180deg,
        var(--img) 180deg 240deg,
        var(--dni) 240deg 300deg,
        var(--otros) 300deg 360deg
    );

    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.tools {
    display: flex;
    align-items: center;
    gap: 9px;
}

.pill {
    min-height: 38px;
    padding: 8px 16px;

    border: 1px solid var(--line);
    border-radius: 999px;

    background: var(--card);
    color: var(--ink);

    font-size: .85rem;
    font-weight: 650;

    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.pill:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pill:active {
    transform: scale(.96);
}

/* ---------- DISTRIBUCIÓN PRINCIPAL ---------- */

main {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;
    padding: 12px 24px 45px;

    display: grid;
    grid-template-columns: 440px minmax(0, 1fr);
    align-items: start;
    gap: 34px;
}

main > section:first-child {
    width: 100%;
    min-width: 0;
}

main > .panel {
    min-width: 0;
}

/* ---------- RUEDA DE CATEGORÍAS ---------- */

.wheel {
    position: relative;

    width: 100%;
    max-width: 440px;
    aspect-ratio: 1;

    margin: 0 auto;
}

.wheel svg.ring {
    display: block;
    width: 100%;
    height: 100%;

    overflow: visible;
}

.sec {
    cursor: pointer;

    opacity: .90;
    transform-origin: 180px 180px;

    transition:
        transform .2s ease,
        opacity .2s ease,
        filter .2s ease;
}

.sec:hover {
    opacity: 1;
    transform: scale(1.035);
    filter: brightness(1.08);
}

.sec.on {
    opacity: 1;
    transform: scale(1.045);
    filter: brightness(1.06);
}

.sec text {
    fill: #ffffff;

    font-family: "Figtree", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 800;

    text-anchor: middle;
    pointer-events: none;

    user-select: none;
}

.sec .em {
    font-size: 22px;
}

/* ---------- CENTRO DEL CÍRCULO ---------- */

#drop {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 41%;
    aspect-ratio: 1;

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

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 12px;

    border: 2px dashed var(--line);
    border-radius: 50%;

    background: var(--card);
    color: var(--ink);

    text-align: center;
    cursor: pointer;

    box-shadow: 0 3px 15px rgba(0, 0, 0, .04);

    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

#drop:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(47, 111, 222, .08);
}

#drop.over {
    border-color: var(--excel);

    background: color-mix(
        in srgb,
        var(--excel) 12%,
        var(--card)
    );

    box-shadow: 0 0 0 8px rgba(30, 158, 98, .12);
}

#drop b {
    max-width: 100%;

    font-size: .95rem;
    line-height: 1.25;
    font-weight: 800;

    overflow-wrap: anywhere;
}

#drop small {
    margin-top: 5px;

    color: var(--mute);

    font-size: .73rem;
    line-height: 1.3;
}

/* ---------- PROGRESO DE CONVERSIÓN ---------- */

#prog {
    position: absolute;

    inset: -6px;

    width: calc(100% + 12px);
    height: calc(100% + 12px);

    transform: rotate(-90deg);

    pointer-events: none;
}

#prog circle {
    fill: none;
    stroke-width: 5;
}

#prog .bg {
    stroke: var(--line);
}

#prog .fg {
    stroke: var(--excel);
    stroke-linecap: round;

    stroke-dasharray: 283;
    stroke-dashoffset: 283;

    transition: stroke-dashoffset .25s ease;
}

/* ---------- TEXTO INFORMATIVO ---------- */

.hint {
    max-width: 440px;

    margin: 15px auto 0;

    color: var(--mute);

    font-size: .79rem;
    line-height: 1.5;

    text-align: center;
}

/* ---------- PANEL PRINCIPAL ---------- */

.panel {
    width: 100%;

    padding: 23px;

    border: 1px solid var(--line);
    border-radius: 24px;

    background: var(--card);

    box-shadow: var(--shadow);

    transition:
        background var(--transition),
        border-color var(--transition);
}

.panel h2 {
    margin: 0 0 7px;

    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -.3px;
}

.panel p {
    margin: 0 0 18px;

    color: var(--mute);

    font-size: .88rem;
    line-height: 1.55;
}

/* ---------- BOTONES DE CONVERSIÓN ---------- */

.acts {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(100px, 1fr));

    gap: 14px;
}

.act {
    width: 100%;
    aspect-ratio: 1;

    padding: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: var(--primary);
    color: #ffffff;

    font-family: inherit;
    font-size: .79rem;
    font-weight: 800;
    line-height: 1.25;

    text-align: center;
    overflow-wrap: anywhere;

    cursor: pointer;

    box-shadow: 0 4px 12px rgba(0, 0, 0, .10);

    transition:
        transform .2s ease,
        filter .2s ease,
        box-shadow .2s ease;
}

.act:hover {
    transform: translateY(-4px) scale(1.04);
    filter: brightness(1.08);

    box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}

.act:active {
    transform: scale(.94);
}

.act:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.soon {
    opacity: .45;
    cursor: not-allowed;
}

/* ---------- ESTADOS Y MENSAJES ---------- */

.status {
    display: none;

    margin-top: 18px;
    padding: 15px;

    border: 1px solid var(--line);
    border-radius: 16px;

    background: var(--bg);
    color: var(--ink);

    font-size: .88rem;
    line-height: 1.5;
}

.status.show {
    display: block;
    animation: appear .25s ease;
}

.status button {
    margin-top: 10px;
}

.status.success {
    border-color: var(--excel);
}

.status.error {
    border-color: var(--danger);
}

.status.warning {
    border-color: var(--warning);
}

/* ---------- HISTORIAL RECIENTE ---------- */

.rec {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;

    margin-top: 20px;

    color: var(--mute);
    font-size: .82rem;
}

.chip {
    width: 39px;
    height: 39px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--primary);
    color: #ffffff;

    font-size: .65rem;
    font-weight: 850;

    cursor: pointer;

    transition: transform .2s ease;
}

.chip:hover {
    transform: scale(1.12);
}

/* ---------- PALETA DE COLORES ---------- */

.pal {
    margin-top: 18px;
    padding: 17px;

    border-radius: 18px;

    background: var(--bg);
    border: 1px solid var(--line);

    animation: appear .25s ease;
}

.pal h3 {
    margin: 0 0 12px;

    font-size: .95rem;
    font-weight: 800;
}

.pre {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.pre .pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 7px 12px;
}

.dots {
    display: inline-flex;
    padding-left: 3px;
}

.dots i {
    width: 13px;
    height: 13px;

    margin-left: -3px;

    border: 1.5px solid var(--card);
    border-radius: 50%;
}

.cust {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(85px, 1fr));

    gap: 13px;

    margin-top: 17px;
}

.cust label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    color: var(--mute);
    font-size: .76rem;
}

.cust input {
    width: 45px;
    height: 45px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: none;

    cursor: pointer;
}

.cust input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.cust input::-webkit-color-swatch {
    border: 2px solid var(--line);
    border-radius: 50%;
}

.cust input::-moz-color-swatch {
    border: 2px solid var(--line);
    border-radius: 50%;
}

/* ---------- ANIMACIONES ---------- */

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- ACCESIBILIDAD ---------- */

button:focus-visible,
#drop:focus-visible,
svg path:focus-visible,
input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

button:disabled {
    cursor: not-allowed;
}

/* ---------- TABLETS ---------- */

@media (max-width: 900px) {
    main {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 24px;
    }

    main > section:first-child {
        max-width: 440px;
    }

    main > .panel {
        max-width: 700px;
    }
}

/* ---------- CELULARES ---------- */

@media (max-width: 600px) {
    header {
        min-height: 65px;
        padding: 12px 14px;
        gap: 8px;
    }

    h1 {
        font-size: 1.05rem;
        gap: 7px;
    }

    .logo {
        width: 25px;
        height: 25px;
    }

    .tools {
        gap: 5px;
    }

    .pill {
        min-height: 35px;
        padding: 7px 10px;
        font-size: .75rem;
    }

    main {
        padding: 10px 14px 30px;
        gap: 20px;
    }

    .wheel {
        max-width: 390px;
    }

    #drop {
        padding: 8px;
    }

    #drop b {
        font-size: .82rem;
    }

    #drop small {
        font-size: .65rem;
    }

    .panel {
        padding: 18px;
        border-radius: 20px;
    }

    .panel h2 {
        font-size: 1.05rem;
    }

    .panel p {
        font-size: .83rem;
    }

    .acts {
        grid-template-columns:
            repeat(auto-fill, minmax(85px, 1fr));

        gap: 11px;
    }

    .act {
        font-size: .72rem;
        padding: 8px;
    }
}

/* ---------- CELULARES PEQUEÑOS ---------- */

@media (max-width: 380px) {
    header {
        padding: 10px;
    }

    h1 {
        font-size: .94rem;
    }

    .pill {
        padding: 6px 8px;
        font-size: .7rem;
    }

    main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .acts {
        grid-template-columns: repeat(3, 1fr);
        gap: 9px;
    }

    .act {
        font-size: .67rem;
    }

    .panel {
        padding: 14px;
    }
}

/* ---------- MOVIMIENTO REDUCIDO ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Ventana de conversión: estilos de la versión integrada */
.converter-modal{position:fixed;inset:0;z-index:10000;background:rgba(8,18,38,.68);display:grid;place-items:center;padding:18px;overflow:auto}
.converter-modal[hidden]{display:none}
.converter-window{width:min(920px,100%);max-height:92vh;overflow:auto;background:var(--panel,#fff);color:var(--text,#172033);border-radius:20px;padding:22px;box-shadow:0 24px 80px rgba(0,0,0,.28)}
.converter-top{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:20px}
.converter-top h2{margin:5px 0}.converter-top p{margin:5px 0;color:var(--muted,#667085)}
.converter-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.converter-source,.converter-output{min-width:0;border:1px solid var(--border,#e5e7eb);border-radius:14px;padding:16px}
.step{font-size:11px;font-weight:800;letter-spacing:.08em;color:var(--muted,#667085);margin:4px 0 12px}
.upload-zone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:130px;border:2px dashed var(--border,#cbd5e1);border-radius:12px;padding:16px;text-align:center;cursor:pointer}
.upload-zone input{position:absolute;width:1px;height:1px;opacity:0}.upload-icon{font-size:28px;color:#2f6fde}
.file-summary{font-size:13px;max-height:110px;overflow:auto;margin:12px 0;color:var(--muted,#667085)}
.format-select{width:100%;padding:12px;border:1px solid var(--border,#cbd5e1);border-radius:10px;background:transparent;color:inherit;margin-bottom:8px}
.format-note,.converter-foot{font-size:12px;color:var(--muted,#667085)}
.converter-modal .primary,.converter-modal .pill{cursor:pointer}.converter-modal button:disabled{opacity:.5;cursor:not-allowed}
.modal-status{font-size:13px;margin-bottom:12px}.output-card{border:1px solid var(--border,#e5e7eb);border-radius:12px;padding:12px;margin:9px 0;display:grid;gap:8px}.output-card small{color:var(--muted,#667085)}.output-buttons{display:flex;flex-wrap:wrap;gap:8px}.converter-foot{margin-top:16px}
@media(max-width:680px){.converter-grid{grid-template-columns:1fr}.converter-window{padding:15px}.converter-top{flex-direction:column}}
