:root {

    --background: #edf2f6;

    --surface: #ffffff;

    --surface-soft: #f8fafc;

    --text: #172337;

    --muted: #64748b;

    --primary: #0f766e;

    --primary-dark: #115e59;

    --primary-soft:

        rgba(15, 118, 110, .12);

    --border: #dbe5ec;

    --danger: #b42318;

    --success: #15803d;



    font-family:

        Inter,

        ui-sans-serif,

        system-ui,

        -apple-system,

        BlinkMacSystemFont,

        "Segoe UI",

        sans-serif;

}





* {

    box-sizing: border-box;

}





body {

    margin: 0;

    min-height: 100vh;

    color: var(--text);

    background:

        radial-gradient(

            circle at top right,

            rgba(15, 118, 110, .14),

            transparent 31rem

        ),

        radial-gradient(

            circle at bottom left,

            rgba(14, 116, 144, .09),

            transparent 28rem

        ),

        var(--background);

}





button,

input {

    font: inherit;

}





button,

a {

    -webkit-tap-highlight-color:

        transparent;

}





/* =====================================================

   PAGINAS

===================================================== */

.login-page,

.account-page {

    width: min(

        33vw,

        520px

    );

    min-width: 360px;

    min-height: 100vh;

    margin:

        0 auto;

    padding:

        42px 0 24px;

    display:

        flex;

    flex-direction:

        column;

    justify-content:

        center;

}





.login-card,

.account-card {

    padding:

        32px;

    border:

        1px solid var(--border);

    border-radius:

        24px;

    background:

        rgba(

            255,

            255,

            255,

            .96

        );

    box-shadow:

        0 24px 65px

        rgba(

            15,

            23,

            42,

            .12

        ),

        0 2px 8px

        rgba(

            15,

            23,

            42,

            .04

        );

    backdrop-filter:

        blur(12px);

}





.login-header,

.account-header {

    text-align:

        center;

}





.brand-mark {

    display:

        grid;

    place-items:

        center;

    width:

        58px;

    height:

        58px;

    margin:

        0 auto 18px;

    border-radius:

        18px;

    color:

        white;

    background:

        linear-gradient(

            135deg,

            var(--primary),

            #0d9488

        );

    box-shadow:

        0 12px 25px

        rgba(

            15,

            118,

            110,

            .25

        );

    font-size:

        1.55rem;

    font-weight:

        900;

}





.brand-logo {

    width:

        44px;

    height:

        44px;

    flex:

        0 0 44px;

    display:

        block;

    object-fit:

        contain;

    border-radius:

        10px;

}





.eyebrow {

    margin:

        0 0 8px;

    color:

        var(--primary);

    font-size:

        .74rem;

    font-weight:

        850;

    letter-spacing:

        .14em;

}





h1 {

    margin:

        0;

    font-size:

        clamp(

            2rem,

            6vw,

            3rem

        );

    letter-spacing:

        -.04em;

}





.subtitle {

    max-width:

        390px;

    margin:

        12px auto 0;

    color:

        var(--muted);

    line-height:

        1.6;

}





/* =====================================================

   FORMULARIOS

===================================================== */

.login-form,

.account-form {

    display:

        grid;

    gap:

        18px;

    margin-top:

        30px;

}





label {

    display:

        grid;

    gap:

        8px;

    color:

        #334155;

    font-size:

        .9rem;

    font-weight:

        780;

}





input {

    width:

        100%;

    min-height:

        49px;

    padding:

        12px 14px;

    border:

        1px solid #cbd5e1;

    border-radius:

        12px;

    color:

        var(--text);

    background:

        var(--surface-soft);

    outline:

        none;

    transition:

        border-color

        .2s ease,

        box-shadow

        .2s ease,

        background

        .2s ease;

}





input::placeholder {

    color:

        #94a3b8;

}





input:hover {

    border-color:

        #aebdca;

}





input:focus {

    border-color:

        var(--primary);

    background:

        #ffffff;

    box-shadow:

        0 0 0 4px

        var(--primary-soft);

}





/* =====================================================

   PASSWORD

===================================================== */

.password-field {

    display:

        grid;

    grid-template-columns:

        minmax(

            0,

            1fr

        )

        auto;

    gap:

        8px;

}





.password-toggle {

    min-width:

        86px;

    padding:

        0 13px;

    border:

        1px solid var(--border);

    border-radius:

        11px;

    color:

        var(--text);

    background:

        #ffffff;

    font-weight:

        750;

    cursor:

        pointer;

}





.password-toggle:hover {

    background:

        #f1f5f9;

}





/* =====================================================

   BOTONES

===================================================== */

.login-button,

.primary-button {

    min-height:

        50px;

    margin-top:

        4px;

    padding:

        12px 18px;

    border:

        0;

    border-radius:

        12px;

    color:

        white;

    background:

        linear-gradient(

            135deg,

            var(--primary),

            #0d9488

        );

    font-weight:

        850;

    cursor:

        pointer;

    box-shadow:

        0 12px 24px

        rgba(

            15,

            118,

            110,

            .2

        );

}





.login-button:hover,

.primary-button:hover {

    filter:

        brightness(.98);

    transform:

        translateY(-1px);

}





.login-button:disabled,

.primary-button:disabled {

    opacity:

        .55;

    cursor:

        not-allowed;

    transform:

        none;

    box-shadow:

        none;

}





/* =====================================================

   MENSAJES

===================================================== */

.response-message {

    min-height:

        22px;

    margin:

        16px 0 0;

    color:

        var(--danger);

    font-size:

        .88rem;

    font-weight:

        650;

    text-align:

        center;

}





.response-message.success {

    color:

        var(--success);

}





/* =====================================================

   LINKS DE CUENTA

===================================================== */

.account-links {

    display:

        grid;

    gap:

        9px;

    margin-top:

        22px;

    padding-top:

        20px;

    border-top:

        1px solid

        var(--border);

}





.account-links a {

    display:

        flex;

    align-items:

        center;

    justify-content:

        space-between;

    gap:

        14px;

    padding:

        12px 13px;

    border:

        1px solid

        transparent;

    border-radius:

        11px;

    color:

        inherit;

    text-decoration:

        none;

    background:

        var(--surface-soft);

}





.account-links a:hover {

    border-color:

        var(--border);

    background:

        #ffffff;

    transform:

        translateX(2px);

}





.account-links span {

    color:

        var(--muted);

    font-size:

        .84rem;

}





.account-links strong {

    flex:

        0 0 auto;

    color:

        var(--primary);

    font-size:

        .84rem;

}





/* =====================================================

   FOOTER

===================================================== */

.page-footer {

    display:

        flex;

    justify-content:

        center;

    gap:

        8px;

    margin-top:

        22px;

    color:

        var(--muted);

    font-size:

        .78rem;

    text-align:

        center;

}





.page-footer span:first-child {

    color:

        var(--primary);

    font-weight:

        850;

}





.page-footer span + span::before {

    content:

        "·";

    margin-right:

        8px;

}





/* =====================================================

   INSTALACION PWA

===================================================== */

.pwa-install-overlay {

    position:

        fixed;

    inset:

        0;

    display:

        flex;

    align-items:

        center;

    justify-content:

        center;

    padding:

        20px;

    background:

        rgba(

            15,

            23,

            42,

            .72

        );

    backdrop-filter:

        blur(4px);

    opacity:

        0;

    visibility:

        hidden;

    transition:

        opacity

        .25s ease,

        visibility

        .25s ease;

    z-index:

        9999;

}





.pwa-install-overlay.show {

    opacity:

        1;

    visibility:

        visible;

}





.pwa-install-card {

    width:

        100%;

    max-width:

        390px;

    padding:

        30px 26px 24px;

    border-radius:

        20px;

    background:

        #ffffff;

    text-align:

        center;

    box-shadow:

        0 25px 60px

        rgba(

            0,

            0,

            0,

            .30

        );

    transform:

        translateY(15px);

    transition:

        transform

        .25s ease;

}





.pwa-install-overlay.show

.pwa-install-card {

    transform:

        translateY(0);

}





.pwa-install-logo {

    width:

        88px;

    height:

        88px;

    margin-bottom:

        15px;

    object-fit:

        contain;

    border-radius:

        18px;

}





.pwa-install-card h2 {

    margin:

        0 0 10px;

    color:

        #0f172a;

    font-size:

        24px;

}





.pwa-install-card p {

    margin:

        0 0 24px;

    color:

        #64748b;

    font-size:

        15px;

    line-height:

        1.5;

}





.pwa-install-actions {

    display:

        flex;

    flex-direction:

        column;

    gap:

        10px;

}





.pwa-install-button {

    width:

        100%;

    padding:

        13px 18px;

    border:

        none;

    border-radius:

        10px;

    color:

        #ffffff;

    background:

        linear-gradient(

            135deg,

            var(--primary),

            #0d9488

        );

    font-size:

        15px;

    font-weight:

        700;

    cursor:

        pointer;

    box-shadow:

        0 10px 22px

        rgba(

            15,

            118,

            110,

            .22

        );

    transition:

        filter

        .2s ease,

        transform

        .1s ease;

}





.pwa-install-button:hover {

    filter:

        brightness(.98);

}





.pwa-install-button:active {

    transform:

        scale(.98);

}





.pwa-cancel-button {

    width:

        100%;

    padding:

        11px;

    border:

        none;

    background:

        transparent;

    color:

        #64748b;

    font-size:

        14px;

    cursor:

        pointer;

}





.pwa-cancel-button:hover {

    color:

        #0f172a;

}





/* =====================================================

   IOS

===================================================== */

.pwa-ios-instructions {

    display:

        none;

    margin:

        -4px 0 22px;

    padding:

        16px;

    border:

        1px solid

        var(--border);

    border-radius:

        14px;

    background:

        var(--surface-soft);

    text-align:

        left;

}





.pwa-ios-step {

    margin:

        9px 0;

    color:

        #475569;

    font-size:

        14px;

    line-height:

        1.45;

}





.pwa-ios-step strong {

    display:

        inline-flex;

    align-items:

        center;

    justify-content:

        center;

    width:

        22px;

    height:

        22px;

    margin-right:

        5px;

    border-radius:

        50%;

    color:

        #ffffff;

    background:

        var(--primary);

    font-size:

        12px;

}





.pwa-ios-share-icon {

    width:

        42px;

    height:

        42px;

    margin:

        10px auto;

    display:

        flex;

    align-items:

        center;

    justify-content:

        center;

    border:

        2px solid

        #64748b;

    border-radius:

        10px;

    color:

        #334155;

    font-size:

        30px;

    font-weight:

        400;

}





/* =====================================================

   RESPONSIVE

===================================================== */

@media (

    max-width: 900px

) {

    .login-page,

    .account-page {

        width:

            min(

                100% - 28px,

                520px

            );

        min-width:

            0;

    }

}





@media (

    max-width: 520px

) {

    .login-page,

    .account-page {

        width:

            min(

                100% - 18px,

                520px

            );

        min-width:

            0;

        justify-content:

            flex-start;

        padding-top:

            22px;

    }



    .login-card,

    .account-card {

        padding:

            25px 18px;

        border-radius:

            20px;

    }



    .password-field {

        grid-template-columns:

            1fr;

    }



    .password-toggle {

        min-height:

            42px;

    }



    .account-links a {

        align-items:

            flex-start;

        flex-direction:

            column;

        gap:

            4px;

    }



    .page-footer {

        flex-direction:

            column;

        gap:

            3px;

    }



    .page-footer span + span::before {

        content:

            "";

        margin:

            0;

    }



    .pwa-install-card {

        max-width:

            340px;

        padding:

            26px 20px 20px;

    }



    .pwa-install-logo {

        width:

            76px;

        height:

            76px;

    }

}

.pwa-ios-notice {

    margin-bottom: 18px;

    padding: 14px;

    border-radius: 12px;

    background: rgba(15, 118, 110, .08);

    color: #334155;

}



.pwa-ios-notice strong {

    display: block;

    margin-bottom: 8px;

    color: var(--primary);

    font-size: 15px;

}



.pwa-ios-notice p {

    margin: 7px 0;

    color: #475569;

    font-size: 14px;

    line-height: 1.45;

}



.pwa-ios-section {

    margin-top: 18px;

}



.pwa-ios-section h3 {

    margin: 0 0 10px;

    color: #0f172a;

    font-size: 15px;

}



.pwa-bluefy-button {

    display: block;

    width: 100%;

    margin-top: 18px;

    padding: 13px 16px;

    border-radius: 10px;

    color: #ffffff;

    background:

        linear-gradient(

            135deg,

            var(--primary),

            #0d9488

        );

    text-align: center;

    text-decoration: none;

    font-size: 15px;

    font-weight: 700;

}

/* =====================================================
   PWA V5 - AVISO IOS NO BLOQUEANTE
   ===================================================== */

.pwa-install-overlay {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.pwa-install-card {
    position: relative;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.pwa-close-button {
    position: sticky;
    top: 0;
    z-index: 10;

    float: right;

    width: 38px;
    height: 38px;
    margin: -14px -10px 4px 8px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 50%;

    color: #475569;
    background: rgba(241, 245, 249, .96);

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, .10);
}

.pwa-close-button:active {
    transform: scale(.96);
}

/* El botón de continuar queda claramente visible al final */
.pwa-cancel-button {
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-weight: 750;
}

/* Evitar que el contenido de iOS empuje el botón fuera de pantalla */
@media (max-width: 520px) {

    .pwa-install-overlay {
        align-items: flex-start;
        padding:
            max(8px, env(safe-area-inset-top))
            8px
            max(8px, env(safe-area-inset-bottom));
    }

    .pwa-install-card {
        max-width: 100%;
        max-height: calc(
            100dvh
            - max(8px, env(safe-area-inset-top))
            - max(8px, env(safe-area-inset-bottom))
            - 16px
        );

        margin: 0;
        padding: 18px 14px 14px;
        border-radius: 16px;
    }

    .pwa-install-logo {
        width: 58px;
        height: 58px;
        margin-bottom: 8px;
    }

    .pwa-install-card h2 {
        font-size: 20px;
        margin-bottom: 7px;
    }

    .pwa-install-card > p {
        margin-bottom: 14px;
        font-size: 14px;
    }

    .pwa-ios-instructions {
        margin-bottom: 14px;
        padding: 12px;
    }

    .pwa-ios-section {
        margin-top: 14px;
    }

    .pwa-install-actions {
        position: sticky;
        bottom: -14px;
        z-index: 8;

        margin:
            8px -14px -14px;

        padding:
            10px 14px
            calc(
                10px
                + env(safe-area-inset-bottom)
            );

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

        background:
            rgba(255, 255, 255, .97);

        backdrop-filter: blur(8px);
    }

    .pwa-cancel-button {
        background: #f8fafc;
    }
}


/* =====================================================
   CUENTA PENDIENTE / CORRECCIÓN DE EMAIL
   ===================================================== */

.pending-account-danger {
    margin-top: 26px;
    padding: 18px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fff7f7;
}

.pending-account-danger h2 {
    margin: 0 0 8px;
    color: #7f1d1d;
    font-size: 1rem;
}

.pending-account-danger p {
    margin: 0 0 14px;
    color: #64748b;
    font-size: .84rem;
    line-height: 1.5;
}

.pending-delete-button {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    background: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.pending-delete-button:hover {
    color: #ffffff;
    background: #991b1b;
    border-color: #991b1b;
}

.pending-delete-dialog {
    width: min(92vw, 430px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
}

.pending-delete-dialog::backdrop {
    background: rgba(15, 23, 42, .55);
}

.pending-delete-dialog-content {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .20);
}

.pending-delete-dialog-content h3 {
    margin: 0 0 8px;
    color: #991b1b;
    font-size: 1.15rem;
}

.pending-delete-dialog-content p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.5;
}

.pending-delete-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.pending-delete-cancel,
.pending-delete-confirm {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}

.pending-delete-cancel {
    border: 1px solid var(--border);
    color: var(--text);
    background: #ffffff;
}

.pending-delete-confirm {
    border: 1px solid #991b1b;
    color: #ffffff;
    background: #991b1b;
}

@media (max-width: 520px) {
    .pending-delete-dialog-actions {
        grid-template-columns: 1fr;
    }
}
