:root {
    --bg-1: #583574;
    --bg-2: #25152f;
    --bg-3: #0c0910;

    --text: #ffffff;
    --muted: rgba(255,255,255,.72);

    --card-bg: rgba(255,255,255,.07);
    --card-border: rgba(255,255,255,.12);
    --input-bg: rgba(0,0,0,.28);
    --input-border: rgba(255,255,255,.15);

    --button-text: #17111d;
    --button-bg: #ffffff;

    --badge-border: rgba(255,255,255,.15);
    --mock-bg: rgba(255,255,255,.08);

    --shadow: 0 30px 80px rgba(0,0,0,.25);
}

body[data-theme="light"] {
    --bg-1: #f2e7ff;
    --bg-2: #f9f4ff;
    --bg-3: #ffffff;

    --text: #2d1b39;
    --muted: rgba(45,27,57,.75);

    --card-bg: rgba(255,255,255,.74);
    --card-border: rgba(88,53,116,.15);
    --input-bg: rgba(255,255,255,.9);
    --input-border: rgba(88,53,116,.18);

    --button-text: #ffffff;
    --button-bg: #583574;

    --badge-border: rgba(88,53,116,.18);
    --mock-bg: rgba(88,53,116,.08);

    --shadow: 0 20px 60px rgba(66,37,88,.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, var(--bg-1) 0, var(--bg-2) 40%, var(--bg-3) 100%);
    transition: background .25s ease, color .25s ease;
}

.shell {
    width: min(900px, 92%);
    margin: auto;
    padding: 24px 0 100px;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.topbar-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.control-btn,
.lang-btn {
    appearance: none;
    border: 1px solid var(--badge-border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
    transition: all .2s ease;
}

.control-btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    backdrop-filter: blur(18px);
}

.lang-switch {
    display: inline-flex;
    gap: 6px;
}

.lang-btn.active {
    font-weight: 800;
}

.hero {
    text-align: center;
    margin-bottom: 36px;
}

.note {
    font-size: 72px;
    line-height: 1;
}

.badge {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 13px;
    border: 1px solid var(--badge-border);
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: .16em;
    opacity: .85;
}

h1 {
    margin: 8px 0;
    font-size: clamp(55px, 11vw, 105px);
    letter-spacing: -.055em;
}

.hero h2 {
    margin: 12px auto;
    max-width: 700px;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 500;
}

.lead {
    max-width: 620px;
    margin: 15px auto;
    line-height: 1.6;
    color: var(--muted);
}

.card {
    padding: 30px;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    background: var(--card-bg);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    transition: background .25s ease, border-color .25s ease;
}

label {
    display: block;
    margin-bottom: 22px;
    font-weight: 650;
}

input,
textarea,
select {
    width: 100%;
    margin-top: 8px;
    padding: 15px 16px;
    border: 1px solid var(--input-border);
    border-radius: 13px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

textarea {
    resize: vertical;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

button[type="submit"] {
    width: 100%;
    padding: 18px;
    border: 0;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 850;
    cursor: pointer;
    background: var(--button-bg);
    color: var(--button-text);
}

button[type="submit"]:disabled {
    cursor: wait;
    opacity: .6;
}

.result {
    margin-top: 25px;
}

.result pre {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.7;
    opacity: .92;
}

.mock {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    background: var(--mock-bg);
}

.hidden {
    display: none;
}

@media (max-width: 650px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .card {
        padding: 20px;
    }

    .topbar {
        justify-content: center;
    }

    .topbar-group {
        justify-content: center;
    }
}


/* ==================================================================
   CANTALE BRAND LOGO R1
   ================================================================== */

.brand-logo-wrap {

    width: 205px;
    height: 205px;

    margin:
        0 auto
        6px;

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

    border-radius: 34px;

    background:
        radial-gradient(
            circle at center,
            rgba(255,255,255,.96) 0%,
            rgba(255,255,255,.90) 48%,
            rgba(255,255,255,.38) 68%,
            rgba(255,255,255,0) 78%
        );

    transition:
        background .25s ease,
        transform .25s ease;
}


.brand-logo {

    display: block;

    width: 190px;
    height: 190px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 16px 25px
            rgba(0,0,0,.24)
        );
}


body[data-theme="light"]
.brand-logo-wrap {

    background:
        radial-gradient(
            circle at center,
            rgba(255,255,255,.85) 0%,
            rgba(255,255,255,.55) 50%,
            rgba(255,255,255,0) 76%
        );
}


body[data-theme="light"]
.brand-logo {

    filter:
        drop-shadow(
            0 12px 24px
            rgba(50,25,65,.14)
        );
}


@media (max-width: 650px) {

    .brand-logo-wrap {

        width: 170px;
        height: 170px;
    }


    .brand-logo {

        width: 160px;
        height: 160px;
    }

}



/* ==================================================================
   CANTALE REAL PLAYER R1
   ================================================================== */

.cantale-player-area {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.12);
}

body[data-theme="light"] .cantale-player-area {
    border-color: rgba(40,20,55,.12);
    background: rgba(255,255,255,.65);
}

.cantale-audio-player {
    display: block;
    width: 100%;
}

.cantale-download {
    display: block;
    margin-top: 14px;
    padding: 13px 16px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    color: inherit;
    border: 1px solid currentColor;
    transition:
        transform .15s ease,
        opacity .15s ease;
}

.cantale-download:hover {
    transform: translateY(-1px);
    opacity: .88;
}



/* ==================================================================
   CANTALE FLOW R2
   LETRA → REVISIÓN → CANCIÓN
   ================================================================== */

.draft-hint {
    margin:
        10px 0
        22px;

    color:
        var(--muted);

    line-height:
        1.6;

    text-align:
        center;
}


.lyrics-editor-label {
    display:
        block;

    margin-top:
        18px;
}


.lyrics-editor-label > span {
    display:
        block;

    margin-bottom:
        10px;

    font-weight:
        700;
}


.lyrics-editor {
    width:
        100%;

    min-height:
        430px;

    box-sizing:
        border-box;

    resize:
        vertical;

    padding:
        20px;

    border:
        1px solid
        var(--input-border);

    border-radius:
        16px;

    background:
        var(--input-bg);

    color:
        var(--text);

    font:
        inherit;

    font-size:
        15px;

    line-height:
        1.7;

    outline:
        none;

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


.lyrics-editor:focus {
    border-color:
        rgba(
            255,
            255,
            255,
            .45
        );

    box-shadow:
        0 0 0 3px
        rgba(
            255,
            255,
            255,
            .06
        );
}


body[data-theme="light"]
.lyrics-editor:focus {
    border-color:
        rgba(
            90,
            50,
            120,
            .35
        );

    box-shadow:
        0 0 0 3px
        rgba(
            90,
            50,
            120,
            .06
        );
}


.flow-actions {
    display:
        grid;

    grid-template-columns:
        1fr 1.35fr;

    gap:
        14px;

    margin-top:
        20px;
}


.flow-actions button {
    min-height:
        54px;

    margin:
        0;
}


.flow-secondary {
    background:
        transparent !important;

    color:
        var(--text) !important;

    border:
        1px solid
        var(--input-border) !important;
}


.flow-secondary:hover {
    background:
        rgba(
            255,
            255,
            255,
            .07
        ) !important;
}


body[data-theme="light"]
.flow-secondary:hover {
    background:
        rgba(
            70,
            40,
            90,
            .05
        ) !important;
}


.flow-primary {
    font-weight:
        900;
}


.flow-actions button:disabled {
    opacity:
        .55;

    cursor:
        wait;

    transform:
        none !important;
}


#musicStatus {
    margin-top:
        16px;
}


@media (
    max-width: 720px
) {

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

    .lyrics-editor {
        min-height:
            360px;
    }
}



/* ==================================================================
   CANTALE FLOW R3
   PREVIEW GRATIS → PLAN → PAGO
   ================================================================== */

.preview-lead {
    max-width:
        760px;

    margin:
        12px auto
        24px;

    color:
        var(--muted);

    text-align:
        center;

    line-height:
        1.6;
}


.preview-grid {
    display:
        grid;

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

    gap:
        12px;

    margin-top:
        22px;
}


.preview-item {
    padding:
        16px;

    border:
        1px solid
        var(--input-border);

    border-radius:
        14px;

    background:
        var(--input-bg);

    text-align:
        center;
}


.preview-item span {
    display:
        block;

    margin-bottom:
        6px;

    color:
        var(--muted);

    font-size:
        12px;

    text-transform:
        uppercase;

    letter-spacing:
        .06em;
}


.preview-item strong {
    display:
        block;

    font-size:
        15px;

    line-height:
        1.35;
}


.preview-story {
    margin-top:
        18px;

    padding:
        20px;

    border:
        1px solid
        var(--input-border);

    border-radius:
        16px;

    background:
        var(--input-bg);
}


.preview-story > span {
    display:
        block;

    margin-bottom:
        10px;

    color:
        var(--muted);

    font-size:
        12px;

    font-weight:
        700;

    text-transform:
        uppercase;

    letter-spacing:
        .06em;
}


.preview-story p {
    margin:
        0;

    line-height:
        1.7;
}


.plans-section h2 {
    text-align:
        center;

    margin-bottom:
        28px;
}


.plan-grid {
    display:
        grid;

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

    gap:
        16px;
}


.plan-card {
    position:
        relative;

    display:
        flex;

    flex-direction:
        column;

    align-items:
        stretch;

    min-height:
        300px;

    margin:
        0;

    padding:
        28px 22px;

    border:
        1px solid
        var(--input-border);

    border-radius:
        20px;

    background:
        var(--input-bg);

    color:
        var(--text);

    text-align:
        left;

    cursor:
        pointer;

    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}


.plan-card:hover {
    transform:
        translateY(-3px);

    border-color:
        rgba(
            255,
            255,
            255,
            .35
        );
}


.plan-card.selected {
    border:
        2px solid
        var(--text);

    box-shadow:
        0 0 0 4px
        rgba(
            255,
            255,
            255,
            .07
        );
}


.plan-card.recommended {
    transform:
        scale(1.025);
}


.plan-card.recommended:hover {
    transform:
        scale(1.025)
        translateY(-3px);
}


.recommended-badge {
    position:
        absolute;

    top:
        -12px;

    left:
        50%;

    transform:
        translateX(-50%);

    padding:
        6px 13px;

    border-radius:
        999px;

    background:
        var(--button-bg);

    color:
        var(--button-text);

    font-size:
        11px;

    font-weight:
        900;

    white-space:
        nowrap;
}


.plan-name {
    margin-top:
        6px;

    font-size:
        18px;

    font-weight:
        900;

    letter-spacing:
        .04em;
}


.plan-price {
    display:
        block;

    margin:
        18px 0
        24px;

    font-size:
        34px;

    font-weight:
        900;
}


.plan-feature {
    display:
        block;

    margin:
        7px 0;

    color:
        var(--muted);

    line-height:
        1.45;
}


.plan-feature::before {
    content:
        "✓ ";

    color:
        var(--text);

    font-weight:
        900;
}


.checkout-btn {
    width:
        100%;

    margin-top:
        24px;
}


.checkout-message {
    margin-top:
        18px;

    padding:
        16px 18px;

    border:
        1px solid
        var(--input-border);

    border-radius:
        14px;

    background:
        var(--input-bg);

    text-align:
        center;

    font-weight:
        700;
}


@media (
    max-width: 900px
) {

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


    .plan-grid {
        grid-template-columns:
            1fr;
    }


    .plan-card.recommended {
        transform:
            none;
    }


    .plan-card.recommended:hover {
        transform:
            translateY(-3px);
    }
}


@media (
    max-width: 520px
) {

    .preview-grid {
        grid-template-columns:
            1fr;
    }
}



/* CANTALE ORDER BUTTON R4.1 */

.checkout-btn.checkout-inactive {
    opacity: 0.58;
    cursor: not-allowed;
}

.checkout-btn[aria-busy="true"] {
    opacity: 0.72;
    cursor: progress;
}



/* ==============================================================
   CANTALE · CHECKOUT ACTION R5
   ============================================================== */

.checkout-action {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    min-height: 58px !important;

    margin-top: 24px !important;
    padding: 16px 24px !important;

    position: relative !important;
    z-index: 100 !important;

    pointer-events: auto !important;

    border: 0 !important;
    border-radius: 16px !important;

    font-size: 16px !important;
    font-weight: 900 !important;
    letter-spacing: .03em !important;

    cursor: pointer !important;
}

.checkout-action[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed !important;
}

.checkout-action[aria-disabled="false"] {
    opacity: 1;
    cursor: pointer !important;
}

.checkout-action[aria-busy="true"] {
    opacity: .75;
    cursor: progress !important;
}


/* ==============================================================
   CANTALE PAYMENT TRUTH R6
   ============================================================== */

.buyer-details {
    margin-top: 26px;
    padding: 22px;
    border: 1px solid var(--input-border);
    border-radius: 18px;
    background: var(--input-bg);
}

.buyer-details h3 {
    margin: 0 0 18px;
    font-size: 18px;
}

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

.buyer-grid label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 700;
}

.buyer-grid label:last-child {
    grid-column: 1 / -1;
}

.buyer-grid input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    box-sizing: border-box;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

.buyer-grid small {
    opacity: .7;
    font-weight: 500;
}

.buyer-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}

.buyer-consent input {
    margin-top: 3px;
}

.payment-return {
    margin-bottom: 24px;
}

.payment-return-text {
    padding: 24px;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
}

@media (max-width: 720px) {

    .buyer-grid {
        grid-template-columns: 1fr;
    }

    .buyer-grid label:last-child {
        grid-column: auto;
    }
}


/* ==============================================================
   CANTALE PAID CREATION R7
   ============================================================== */

.paid-creation {
    margin-bottom: 28px;
}

.paid-creation-status,
.paid-music-status {
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid var(--input-border);
    border-radius: 14px;
    background: var(--input-bg);
    font-weight: 800;
}

.paid-lyrics-area {
    margin-top: 22px;
}

.paid-lyrics-area label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

#paidSongTitle,
#paidLyricsEditor {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--input-border);
    border-radius: 14px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

#paidSongTitle {
    min-height: 48px;
    padding: 12px 14px;
}

#paidLyricsEditor {
    min-height: 380px;
    padding: 16px;
    resize: vertical;
    line-height: 1.55;
}

.paid-help {
    opacity: .78;
    line-height: 1.5;
}

.paid-actions {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1.5fr);
    gap: 14px;
    margin-top: 20px;
}

.paid-actions button {
    min-height: 54px;
}

.paid-music-area {
    margin-top: 24px;
}

#paidAudio {
    width: 100%;
    margin-top: 16px;
}

.paid-download {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin-top: 16px;
    padding: 0 20px;
    border-radius: 14px;
    font-weight: 900;
    text-decoration: none;
}

#retryPaidLyricsBtn {
    min-height: 48px;
    margin-top: 16px;
}

@media (max-width: 720px) {

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

    #paidLyricsEditor {
        min-height: 320px;
    }
}


/* ==============================================================
   CANTALE REAL CREATION PROGRESS R7.2
   Progreso por estados reales; sin porcentajes simulados.
   ============================================================== */

.creation-progress {
    display: grid;
    grid-template-columns:
        repeat(6, minmax(0, 1fr));
    gap: 0;
    margin: 26px 0 12px;
    padding: 0;
}

.creation-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    min-width: 0;
    text-align: center;
    opacity: .45;
}

.creation-step::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 15px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--input-border);
}

.creation-step:first-child::before {
    display: none;
}

.creation-dot {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--input-border);
    border-radius: 999px;
    background: var(--input-bg);
    font-size: 15px;
    font-weight: 900;
}

.creation-label {
    padding: 0 4px;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 800;
}

.creation-step.done,
.creation-step.active {
    opacity: 1;
}

.creation-step.done .creation-dot {
    border-color: #6d3bf5;
    background: #6d3bf5;
    color: #fff;
}

.creation-step.done::before {
    background: #6d3bf5;
}

.creation-step.active .creation-dot {
    border-color: #6d3bf5;
    color: #6d3bf5;
    animation:
        cantale-progress-pulse
        1.45s ease-in-out infinite;
}

.creation-progress-detail {
    min-height: 24px;
    margin: 10px 0 24px;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
    opacity: .82;
}

@keyframes cantale-progress-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0
            rgba(109, 59, 245, .28);
    }

    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 0 8px
            rgba(109, 59, 245, 0);
    }
}

@media (max-width: 760px) {

    .creation-progress {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-left: 6px;
    }

    .creation-step {
        min-height: 34px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        text-align: left;
    }

    .creation-step::before {
        top: -14px;
        left: 14px;
        width: 2px;
        height: 18px;
    }

    .creation-label {
        font-size: 14px;
    }

    .creation-progress-detail {
        text-align: left;
        margin-left: 48px;
    }
}



/* ==============================================================
   CANTALE R7.6D2 · CONSENT UX
   ============================================================== */

#buyerDetails .buyer-consents {
    display: grid;
    gap: 10px;
    width: 100%;
    margin-top: 18px;
}

#buyerDetails .buyer-consent {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 11px !important;

    width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px !important;

    box-sizing: border-box;

    font-size: 14px;
    line-height: 1.45;
    text-align: left;

    border-radius: 10px;

    cursor: pointer;
}

#buyerDetails .buyer-consent:hover {
    background: rgba(255,255,255,.045);
}

#buyerDetails
.buyer-consent
input[type="checkbox"] {

    appearance: auto !important;
    -webkit-appearance: checkbox !important;

    display: block !important;

    flex: 0 0 20px !important;

    width: 20px !important;
    height: 20px !important;

    min-width: 20px !important;
    min-height: 20px !important;

    max-width: 20px !important;
    max-height: 20px !important;

    margin: 1px 0 0 0 !important;
    padding: 0 !important;

    cursor: pointer;

    accent-color: #8f58b7;
}

#buyerDetails .buyer-consent span {
    display: block;
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
}

#buyerDetails
.buyer-consent-required span {
    font-weight: 650;
}

#buyerDetails
.buyer-consent-marketing {
    opacity: .82;
}

#buyerDetails
.buyer-consent-marketing span {
    font-size: .94em;
    font-weight: 500;
}

