:root {
    --background: #000000;
    --surface: #1c1c1e;
    --surface-light: #2c2c2e;
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-secondary: #a1a1a6;
    --blue: #0a84ff;
    --blue-dark: #0071e3;
    --green: #30d158;
    --radius-large: 28px;
    --radius-medium: 20px;
    --radius-small: 14px;
}


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


html {
    background: var(--background);
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}


body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(10, 132, 255, 0.12),
            transparent 40%
        ),
        var(--background);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
    padding:
        env(safe-area-inset-top)
        0
        env(safe-area-inset-bottom);
    overflow-x: hidden;
    touch-action: manipulation;
}


button,
label,
input,
select,
textarea {
    font: inherit;
}


button,
label,
a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}


input,
button,
select,
textarea {
    font-size: 16px;
}


button {
    border: 0;
    cursor: pointer;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding:
        28px
        20px
        48px;
}


/* =========================================================
   HEADER
   ========================================================= */

.app-header {
    display: flex;
    justify-content: center;
    align-items: center;

    margin-top: 45px;
    margin-bottom: 50px;
}


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

    text-align: center;
}


.brand-icon {
    width: 76px;
    height: 76px;
    min-width: 76px;

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

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #0a84ff,
            #0071e3
        );

    color: #ffffff;

    font-size: 22px;
    font-weight: 800;

    box-shadow:
        0 8px 30px
        rgba(10, 132, 255, 0.25);

    transition:
        transform 0.25s ease,
        opacity 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}


.brand h1 {
    margin-top: 14px;

    font-size: 27px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.7px;
}


.brand p {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 14px;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    min-height: 62vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}


.empty-icon {
    width: 82px;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
}


.empty-icon svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: var(--blue);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.empty-state h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.8px;
}


.empty-state > p:not(.privacy-text) {
    max-width: 330px;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary-button {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 28px;
    padding: 0 24px;
    border-radius: 18px;
    background:
        linear-gradient(
            180deg,
            #0a84ff,
            #0071e3
        );
    color: #ffffff;
    font-size: 17px;
    font-weight: 650;
    box-shadow:
        0 10px 28px
        rgba(10, 132, 255, 0.25);
}


.primary-button:active {
    transform: scale(0.97);
}


.button-icon {
    font-size: 25px;
    line-height: 1;
}


.secondary-button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}


/* =========================================================
   PRIVACY
   ========================================================= */

.privacy-text {
    max-width: 390px;
    margin-top: 22px;
    color: #7f7f85;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}


/* =========================================================
   WORKSPACE
   ========================================================= */

.workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
}


.hidden {
    display: none !important;
}


/* =========================================================
   SUMMARY
   ========================================================= */

.summary-card {
    display: grid;
    grid-template-columns:
        1fr
        auto
        1fr;
    align-items: center;
    padding: 24px 20px;
    border-radius: var(--radius-large);
    background:
        linear-gradient(
            145deg,
            #1d1d1f,
            #171719
        );
    border: 1px solid var(--border);
}


.summary-column {
    text-align: center;
}


.summary-column > span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 14px;
}


.summary-column strong {
    display: block;
    font-size: 24px;
    line-height: 1;
}


.summary-column small {
    display: block;
    margin-top: 7px;
    color: #77777c;
    font-size: 12px;
}


.summary-divider {
    width: 1px;
    height: 48px;
    background:
        rgba(255, 255, 255, 0.1);
}


.saving {
    margin-top: 8px;
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   SECTION CARD
   ========================================================= */

.section-card {
    padding: 22px;
    border-radius: var(--radius-large);
    background: var(--surface);
    border: 1px solid var(--border);
}


.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}


.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.4px;
}


.section-header p {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}


.text-button {
    flex-shrink: 0;
    padding: 7px 0;
    background: transparent;
    color: var(--blue);
    font-size: 15px;
    font-weight: 600;
}


/* =========================================================
   PHOTO ACTIONS
   ========================================================= */

.selection-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}


/* =========================================================
   PHOTO GRID
   ========================================================= */

.photo-grid {
    display: grid;
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
    gap: 8px;
}


.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    background: var(--surface-light);
}


.photo-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}


.photo-number {
    position: absolute;
    right: 7px;
    bottom: 7px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
}


/* =========================================================
   QUALITY
   ========================================================= */

.quality-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.quality-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 15px 16px;
    border-radius: 18px;
    background: #252527;
    border: 1px solid transparent;
    cursor: pointer;
}


.quality-card.selected {
    background:
        rgba(10, 132, 255, 0.13);
    border-color:
        rgba(10, 132, 255, 0.55);
}


.quality-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}


.radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #636366;
}


.quality-card.selected .radio {
    border-color: var(--blue);
    background:
        radial-gradient(
            circle,
            var(--blue) 0 45%,
            transparent 48%
        );
}


.quality-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.quality-content strong {
    font-size: 16px;
    font-weight: 650;
}


.quality-content small {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}


/* =========================================================
   TARGET SIZE
   ========================================================= */

.target-container {
    margin-top: 14px;
}


.target-divider {
    height: 1px;
    margin:
        18px 0
        24px;
    background:
        rgba(255, 255, 255, 0.10);
}


.target-container h3 {
    margin-bottom: 18px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}


/* =========================================================
   TARGET BUTTONS
   ========================================================= */

.target-options {
    display: grid;
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
    gap: 10px;
}


.target-option {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 18px;
    background: #2c2c2e;
    color: #ffffff;
    font-size: 18px;
    font-weight: 650;
    transition:
        transform 0.15s ease,
        background 0.15s ease;
}


.target-option.active {
    background: var(--blue);
}


.target-option:active {
    transform: scale(0.96);
}


/* =========================================================
   CUSTOM TARGET
   ========================================================= */

.custom-target {
    margin-top: 12px;
}


.custom-target-input {
    display: flex;
    align-items: center;
    overflow: hidden;
    min-height: 56px;
    border-radius: 16px;
    background: #2c2c2e;
    border: 1px solid
        rgba(255, 255, 255, 0.08);
}


.custom-target-input input {
    width: 100%;
    min-width: 0;
    padding: 0 16px;
    outline: none;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 18px;
}


.custom-target-input span {
    padding-right: 16px;
    color: var(--text-secondary);
    font-size: 16px;
}


.target-description {
    margin-top: 18px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   APP OPTIONS
   ========================================================= */

.option-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.option-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 70px;
    padding: 15px 16px;
    border-radius: 18px;
    background: #252527;
    border: 1px solid transparent;
    cursor: pointer;
}


.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}


.option-switch {
    flex-shrink: 0;
    width: 44px;
    height: 26px;
    border-radius: 20px;
    background: #3a3a3c;
    position: relative;
    transition:
        background 0.15s ease;
}


.option-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    transition:
        transform 0.15s ease;
}


.option-card input:checked + .option-switch {
    background: var(--blue);
}


.option-card input:checked + .option-switch::after {
    transform: translateX(18px);
}


.option-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.option-content strong {
    font-size: 16px;
    font-weight: 650;
}


.option-content small {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}


.option-note {
    margin-top: 12px;
    color: #7f7f85;
    font-size: 12px;
    line-height: 1.45;
}


/* =========================================================
   COMPRESS BUTTON
   ========================================================= */

.compress-button {
    width: 100%;
    min-height: 62px;
    border-radius: 21px;
    background:
        linear-gradient(
            180deg,
            #0a84ff,
            #0071e3
        );
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    box-shadow:
        0 12px 32px
        rgba(10, 132, 255, 0.28);
}


.compress-button:active {
    transform: scale(0.98);
}


.compress-button:disabled {
    opacity: 0.5;
}


/* =========================================================
   PROGRESS
   ========================================================= */

.progress-card {
    padding: 18px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
}


.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 11px;
    color: var(--text-secondary);
    font-size: 14px;
}


.progress-header span:last-child {
    color: var(--text);
    font-weight: 600;
}


.progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 20px;
    background: #343437;
}


.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: width 0.2s ease;
}


/* =========================================================
   RESULT
   ========================================================= */

.result-card {
    padding: 30px 22px;
    border-radius: var(--radius-large);
    background:
        linear-gradient(
            145deg,
            rgba(48, 209, 88, 0.10),
            var(--surface)
        );
    border:
        1px solid
        rgba(48, 209, 88, 0.2);
    text-align: center;
}


.result-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border-radius: 50%;
    background:
        rgba(48, 209, 88, 0.15);
    color: var(--green);
    font-size: 28px;
    font-weight: 700;
}


.result-card h2 {
    font-size: 22px;
    font-weight: 700;
}


.result-card p {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}


.result-card .primary-button {
    margin-top: 20px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 520px) {

    .app {
        padding:
            24px
            16px
            40px;
    }


    .app-header {
        margin-top: 45px;
        margin-bottom: 50px;
    }


    .brand-icon {
        width: 76px;
        height: 76px;
        min-width: 76px;
        border-radius: 22px;
        font-size: 22px;
    }


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


    .empty-state {
        min-height: 60vh;
    }


    .empty-state h2 {
        font-size: 25px;
    }


    .summary-card {
        padding: 20px 14px;
    }


    .summary-column strong {
        font-size: 21px;
    }


    .section-card {
        padding: 18px;
    }


    .photo-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }


    .quality-card {
        min-height: 72px;
        padding: 14px;
    }


    .quality-content strong {
        font-size: 15px;
    }


    .quality-content small {
        font-size: 12px;
    }


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


    .target-option {
        min-height: 68px;
        font-size: 20px;
    }


    .option-card {
        min-height: 68px;
        padding: 14px;
    }


    .option-content strong {
        font-size: 15px;
    }


    .option-content small {
        font-size: 12px;
    }

}


/* =========================================================
   IPHONE
   ========================================================= */

@media (max-width: 430px) {

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


    .target-option {
        border-radius: 17px;
    }

}


/* =========================================================
   EASTER EGG - LOGO
   ========================================================= */

#easterEggLogo,
.brand-icon {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}


.brand-icon.easter-active {
    transform:
        scale(1.12);

    background:
        linear-gradient(
            145deg,
            #ff375f,
            #ff1744
        );

    box-shadow:
        0 10px 35px
        rgba(
            255,
            55,
            95,
            0.35
        );

    color:
        #ffffff;

    font-size:
        26px;

    font-weight:
        800;
}


/* =========================================================
   EASTER EGG - MENSAJE
   ========================================================= */

.easter-egg-message {
    position: fixed;

    top: 50%;
    left: 50%;

    z-index: 9999;

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

    min-width: 250px;

    padding:
        26px
        30px;

    border-radius: 24px;

    background:
        rgba(
            28,
            28,
            30,
            0.96
        );

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

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

    text-align: center;

    opacity: 0;

    pointer-events: none;

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

    transition:
        opacity
        0.3s
        ease,

        transform
        0.3s
        ease;

    backdrop-filter:
        blur(
            20px
        );

    -webkit-backdrop-filter:
        blur(
            20px
        );
}


.easter-egg-message.show {
    opacity: 1;

    transform:
        translate(
            -50%,
            -50%
        )
        scale(
            1
        );
}


.easter-egg-heart {
    margin-bottom:
        12px;

    color:
        #ff375f;

    font-size:
        42px;

    line-height:
        1;

    text-shadow:
        0 5px 20px
        rgba(
            255,
            55,
            95,
            0.35
        );
}


.easter-egg-text {
    color:
        #ffffff;

    font-size:
        17px;

    font-weight:
        600;

    line-height:
        1.4;
}


/* =========================================================
   IPHONE - CABECERA
   ========================================================= */

@media (max-width: 430px) {

    .app-header {
        margin-top: 45px;
        margin-bottom: 50px;
    }


    .brand-icon {
        width: 76px;
        height: 76px;
        min-width: 76px;
        border-radius: 22px;
        font-size: 22px;
    }


    .brand h1 {
        margin-top: 14px;
        font-size: 24px;
    }

}


/* =========================================================
   IPHONE / SAFARI - EVITAR ZOOM AUTOMÁTICO
   ========================================================= */

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


body {
    touch-action: manipulation;
}


input,
button,
select,
textarea {
    font-size: 16px;
}


button,
label,
a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}