@font-face {
    font-family: 'SF Pro Display';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/wss/fonts/SF-Pro-Display/v3/sf-pro-display_regular.woff2') format('woff2');
}

@font-face {
    font-family: 'SF Pro Display';
    font-style: normal;
    font-weight: 600;
    src: url('../fonts/wss/fonts/SF-Pro-Display/v3/sf-pro-display_semibold.woff2') format('woff2');
}

@font-face {
    font-family: 'SF Pro Text';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/wss/fonts/SF-Pro-Text/v3/sf-pro-text_regular.woff2') format('woff2');
}

@font-face {
    font-family: 'SF Pro Text';
    font-style: normal;
    font-weight: 600;
    src: url('../fonts/wss/fonts/SF-Pro-Text/v3/sf-pro-text_semibold.woff2') format('woff2');
}

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

:root {
    --apple-blue: #0A84FF;
    --apple-blue-soft: rgba(10, 132, 255, 0.6);
    --apple-blue-dim: rgba(10, 132, 255, 0.18);
    --error-red: #ff3037;
    --error-red-soft: rgba(255, 48, 55, 0.6);
    --error-red-dim: rgba(255, 48, 55, 0.18);
    --face-size: clamp(240px, 62vw, 300px);

    /* Tick palette (swaps to red on .error) */
    --tick-base: var(--apple-blue-dim);
    --tick-soft: var(--apple-blue-soft);
    --tick-active: var(--apple-blue);
    --tick-glow: var(--apple-blue);

    /* Dark theme (default) */
    --bg: #1c1c1e;
    --text: #ffffff;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --dot-border: rgba(235, 235, 245, 0.4);
    --dot-fill: #ffffff;
    --key-bg: rgba(255, 255, 255, 0.12);
    --key-bg-active: rgba(255, 255, 255, 0.22);
    --key-text: #ffffff;

    /* Login */
    --muted: rgba(235, 235, 245, 0.55);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.14);
    --input-holder: rgba(235, 235, 245, 0.4);
    --divider: rgba(255, 255, 255, 0.10);

    /* Login (iguales a iCloud) */
    --textbtn: #262222;
    --theme-color-systemBlack: #fff;
    --theme-color-boton: #fff;
    --shadowlogo: 0 18px 45px rgba(0, 0, 0, .35);
    --imageicon-iphone-dark: url('https://appleid.cdn-apple.com/appleauth/static/bin/cb3525652582/dist/assets/iphone-icon.svg');
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #eaeaea;
        --text: #1c1c1e;
        --text-secondary: rgba(60, 60, 67, 0.6);
        --dot-border: rgba(60, 60, 67, 0.4);
        --dot-fill: #1c1c1e;
        --key-bg: rgba(0, 0, 0, 0.08);
        --key-bg-active: rgba(0, 0, 0, 0.16);
        --key-text: #1c1c1e;

        --muted: rgba(60, 60, 67, 0.65);
        --input-bg: rgba(0, 0, 0, 0.03);
        --input-border: rgba(0, 0, 0, 0.16);
        --input-holder: rgba(60, 60, 67, 0.5);
        --divider: rgba(0, 0, 0, 0.10);

        --textbtn: #ffffff;
        --theme-color-systemBlack: #000;
        --theme-color-boton: #000;
        --shadowlogo: none;
        --imageicon-iphone-dark: url('https://appleid.cdn-apple.com/appleauth/static/bin/cb3910871900/dist/assets/iphone-icon-dark.svg');
    }
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(5vh, 32px) 24px max(4vh, 24px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    gap: 24px;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.face-id-icon {
    width: clamp(88px, 20vw, 108px);
    height: clamp(88px, 20vw, 108px);
    margin: 0 auto clamp(22px, 3.5vh, 30px);
    position: relative;
}

.face-id-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.title {
    font-size: clamp(26px, 6.5vw, 34px);
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: clamp(14px, 3.8vw, 16px);
    color: var(--text-secondary);
    margin: 0 auto;
    line-height: 1.45;
    max-width: 320px;
}

.face-container {
    position: relative;
    width: var(--face-size);
    height: var(--face-size);
    margin: 0 auto;
}

.alert-spacer {
    height: 44px;
    flex-shrink: 0;
}

.face-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--tick-base);
    box-shadow: 0 0 24px var(--tick-base);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.face-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.circle-outline {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--face-size) * 1.23);
    height: calc(var(--face-size) * 1.23);
    transform: translate(-50%, -50%);
    pointer-events: none;
    overflow: visible;
}

.circle-outline rect {
    fill: var(--tick-base);
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: tickSweep 3s linear infinite;
}

@keyframes tickSweep {
    0%, 100% {
        transform: scaleY(1) scaleX(1);
        fill: var(--tick-base);
        filter: none;
    }
    8% {
        transform: scaleY(1.15) scaleX(1.1);
        fill: var(--tick-soft);
    }
    15% {
        transform: scaleY(1.55) scaleX(1.35);
        fill: var(--tick-active);
        filter: drop-shadow(0 0 8px var(--tick-glow));
    }
    22% {
        transform: scaleY(1.15) scaleX(1.1);
        fill: var(--tick-soft);
    }
    35%, 100% {
        transform: scaleY(1) scaleX(1);
        fill: var(--tick-base);
        filter: none;
    }
}

/* Error state — swaps blue tick palette for red */
.face-container.error {
    --tick-base: var(--error-red-dim);
    --tick-soft: var(--error-red-soft);
    --tick-active: var(--error-red);
    --tick-glow: var(--error-red);
}

.face-id-icon.error {
    animation: errorBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes errorBounce {
    0%   { transform: scale(1) translateX(0); }
    15%  { transform: scale(1.3) translateX(0); }
    30%  { transform: scale(0.88) translateX(-8px); }
    45%  { transform: scale(1.12) translateX(8px); }
    60%  { transform: scale(0.96) translateX(-5px); }
    75%  { transform: scale(1.04) translateX(3px); }
    100% { transform: scale(1) translateX(0); }
}

/* ---------- Views (alert <-> passcode) ---------- */
.view {
    display: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    width: 100%;
}

.view.is-active {
    display: block;
    opacity: 1;
}

/* ---------- Passcode ---------- */
.passcode {
    position: relative;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 60px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    gap: 28px;
}

.passcode-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    width: 100%;
}

.pcont {
    font-size: clamp(20px, 5.2vw, 22px);
    font-weight: 600;
    letter-spacing: -0.3px;
}

.pcont-fail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    background: var(--error-red-dim);
    color: var(--error-red);
    font-size: clamp(12.5px, 3.4vw, 13.5px);
    font-weight: 600;
    letter-spacing: 0.1px;
    margin-bottom: -6px;
    box-shadow: 0 0 0 0 var(--error-red-soft);
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
}

.view.is-active .pcont-fail {
    animation:
        failEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s forwards,
        failPulse 2.4s ease-out 1s infinite;
}

.pcont-fail-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    overflow: visible;
}

.pcont-fail-face path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.view.is-active .pcont-fail-face path {
    animation: failDraw 0.55s ease-out forwards;
}

.view.is-active .pcont-fail-face path:nth-child(1) { animation-delay: 0.15s; }
.view.is-active .pcont-fail-face path:nth-child(2) { animation-delay: 0.20s; }
.view.is-active .pcont-fail-face path:nth-child(3) { animation-delay: 0.15s; }
.view.is-active .pcont-fail-face path:nth-child(4) { animation-delay: 0.20s; }
.view.is-active .pcont-fail-face path:nth-child(5) { animation-delay: 0.35s; }
.view.is-active .pcont-fail-face path:nth-child(6) { animation-delay: 0.35s; }
.view.is-active .pcont-fail-face path:nth-child(7) { animation-delay: 0.45s; }
.view.is-active .pcont-fail-face path:nth-child(8) { animation-delay: 0.55s; }

.pcont-fail-slash {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    filter: drop-shadow(0 0 3px transparent);
}

.view.is-active .pcont-fail-slash {
    animation:
        failDraw 0.32s ease-out 0.9s forwards,
        failGlow 1.6s ease-in-out 1.3s infinite;
}

@keyframes failEnter {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes failDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes failGlow {
    0%, 100% { filter: drop-shadow(0 0 0 transparent); }
    50%      { filter: drop-shadow(0 0 3px var(--error-red)); }
}

@keyframes failPulse {
    0%   { box-shadow: 0 0 0 0 var(--error-red-soft); }
    60%  { box-shadow: 0 0 0 10px rgba(255, 48, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 48, 55, 0); }
}

.pin {
    display: flex;
    justify-content: center;
    gap: clamp(16px, 4.5vw, 22px);
}

.dot {
    width: clamp(12px, 3.5vw, 14px);
    height: clamp(12px, 3.5vw, 14px);
    border-radius: 50%;
    border: 1.5px solid var(--dot-border);
    background: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dot.filled {
    background: var(--dot-fill);
    border-color: var(--dot-fill);
}

@keyframes shake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-8px); }
    40%  { transform: translateX(8px); }
    60%  { transform: translateX(-6px); }
    80%  { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

.pin.shake { animation: shake 0.4s; }

.keyboard {
    --key-size: clamp(62px, 21vw, 80px);
    display: grid;
    grid-template-columns: repeat(3, var(--key-size));
    gap: clamp(10px, 3vw, 16px);
    justify-content: center;
}

.keyboard button {
    width: var(--key-size);
    height: var(--key-size);
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    font-size: clamp(30px, 8.5vw, 38px);
    font-weight: 400;
    font-family: inherit;
    background: var(--key-bg);
    color: var(--key-text);
    transition: background 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-top: 6px;
}

.keyboard button:active,
.keyboard button.is-pressed {
    background: var(--key-bg-active);
}

.keyboard button span {
    display: block;
    font-size: 10px;
    letter-spacing: 2px;
    margin-top: 3px;
    font-weight: 600;
}

.keyboard .empty {
    pointer-events: none;
    background: transparent;
}

.cancelcode {
    align-self: flex-end;
    text-decoration: none;
    color: var(--apple-blue);
    font-size: 16px;
    font-weight: 400;
    padding: 6px 4px;
}

/* Campo alphanumeric (teclado del sistema) */
.passcode-input {
    width: min(320px, 84%);
    height: 52px;
    margin-top: 6px;
    border-radius: 13px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: clamp(30px, 8.5vw, 38px);
    font-weight: 600;
    text-align: center;
    letter-spacing: 12px;
    text-indent: 12px;
    caret-color: var(--apple-blue);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.passcode-input::placeholder {
    color: var(--input-holder);
}

.passcode-input:focus {
    border-color: rgba(10, 132, 255, .9);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, .35);
}

.passcode-input.shake {
    animation: shake 0.4s;
}

/* Pantallas muy bajas (paisaje móvil): compactar para que quepa sin scroll */
@media (max-height: 640px) {
    .passcode {
        padding: 40px 20px 24px;
        gap: 18px;
    }
    .passcode-head {
        gap: 14px;
    }
    .keyboard {
        --key-size: clamp(52px, 12vh, 68px);
        gap: 10px;
    }
    .keyboard button {
        font-size: clamp(24px, 5vh, 32px);
    }
}

/* ---------- Login (card, 2 pasos) ---------- */
.login-wrap {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.login-card {
    width: min(560px, calc(100% - 24px));
    border-radius: 26px;
    padding: 46px 56px 34px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .03));
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 32px 90px rgba(0, 0, 0, .55);
    box-sizing: border-box;
    text-align: center;
}

@media (prefers-color-scheme: light) {
    .login-card {
        background: #ffffff;
        border-color: rgba(0, 0, 0, .08);
        box-shadow: 0 32px 90px rgba(0, 0, 0, .16);
    }
}

.login-head {
    margin-bottom: 18px;
}

.login-orbit {
    width: 130px;
    height: 130px;
    margin: 0 auto 18px;
    border-radius: 999px;
    filter: saturate(1.15);
    position: relative;
    box-shadow: var(--shadowlogo);
}

.login-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.02em;
}

.login-form {
    margin: 22px auto 0;
    width: min(460px, 100%);
    text-align: left;
}

.login-input {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--input-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.login-input::placeholder {
    color: var(--input-holder);
}

.login-input:focus {
    border-color: rgba(10, 132, 255, .9);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, .35);
}

.login-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12.5px;
    color: #3aa0ff;
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
}

.login-link.inline {
    display: inline;
    margin: 0;
}

.login-people {
    margin: 28px auto 10px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50%;
    background-image: url('https://appleid.cdn-apple.com/appleauth/static/bin/cb1900903086/dist/assets/privacy-icon.png');
    width: 37px;
    height: 32px;
}

.login-note {
    margin: 10px 0 0;
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--muted);
    text-align: center;
}

.login-actions {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
}

.login-actions.two {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
}

.login-btn {
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.login-btn.primary {
    background: #0071e3;
    color: #fff;
}

.login-btn.primary:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.login-btn.secondary {
    background: var(--theme-color-boton);
    color: var(--textbtn);
    border-color: var(--theme-color-boton);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.iphone-icon {
    background-image: var(--imageicon-iphone-dark);
    background-repeat: no-repeat;
    background-size: contain;
    height: 15px;
    width: 15px;
}

.login-foot {
    margin: 10px 0 0;
    font-size: 11.5px;
    color: var(--text);
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Steps */
.step {
    display: none;
}

.step.is-active {
    display: block;
}

.login-actions.single {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Botón grande azul (Iniciar sesión) */
.login-btn.signin {
    height: 44px;
    border-radius: 10px;
    border: 0;
    background: #0a84ff;
    color: rgba(255, 255, 255, .95);
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 12px 28px rgba(10, 132, 255, .22);
    width: 100%;
    margin-top: 25px;
}

.login-btn.signin:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Row: checkbox + link */
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 0;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    user-select: none;
}

.check input {
    width: 14px;
    height: 14px;
    accent-color: #0a84ff;
}

.forgot {
    font-size: 12px;
    color: #3aa0ff;
    text-decoration: none;
    white-space: nowrap;
}

.forgot:hover {
    text-decoration: underline;
}

/* Stack iCloud: 2 inputs en 1 caja */
.field-stack {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 10%, transparent);
}

.stack-row {
    padding: 12px 14px;
}

.stack-divider {
    height: 1px;
    background: var(--divider);
}

.stack-label {
    display: block;
    font-size: 11px;
    margin-bottom: 4px;
    color: color-mix(in srgb, var(--text) 45%, transparent);
}

.stack-input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    padding: 0;
    height: 24px;
}

.stack-input--filled {
    font-weight: 600;
    color: color-mix(in srgb, var(--text) 92%, transparent);
}

.stack-input::placeholder {
    color: var(--input-holder);
}

.field-stack:focus-within {
    border-color: rgba(10, 132, 255, .95);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* Error state (tipo Apple) */
.field-stack.is-error,
.field-stack.is-error:focus-within {
    border-color: rgba(255, 59, 48, .95);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, .25), 0 12px 40px rgba(255, 59, 48, .10), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.login-error {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: rgba(255, 120, 120, .95);
    font-size: 12px;
    line-height: 1.25;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease;
}

.login-error.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.login-error.is-trypass {
    color: #0a84ff;
    font-weight: 600;
    cursor: pointer;
}

.login-error.is-trypass:hover {
    text-decoration: underline;
}

.login-error-icon {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 59, 48, .9);
    position: relative;
    flex: 0 0 14px;
}

.login-error-icon::before {
    content: "!";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 10px;
    line-height: 1;
    color: rgba(255, 120, 120, .95);
}

/* Loading spinner */
.login-btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: .95;
}

.login-btn.is-loading .btn-text {
    opacity: 0;
}

.login-btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: rgba(255, 255, 255, .95);
    animation: btnspin .8s linear infinite;
}

@keyframes btnspin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 520px) {
    .login-card {
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
        width: 100%;
    }

    .login-wrap {
        padding: 32px 24px;
    }

    .login-form {
        width: 100%;
    }

    .login-orbit {
        box-shadow: none;
    }

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

    .login-title {
        font-size: 26px;
    }

    .row {
        flex-direction: column;
        align-items: flex-start;
    }

    .forgot {
        white-space: normal;
    }
}

/* ===== Popup de verificación ===== */
.opc {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: -100px;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    overflow: hidden;
    z-index: 49;
    overscroll-behavior: none;
    height: 120vh;
}

.popup {
    width: 100%;
    padding: 0 12px;
    position: fixed;
    bottom: 20px;
    left: 0;
    display: none;
    z-index: 101;
}

.opc.is-open {
    display: block;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.popup.is-open {
    display: block;
    animation: popupIn 0.3s ease-out;
}

.textpop.shake {
    animation: shake 0.4s;
}

body.no-scroll {
    overflow: hidden;
}

@keyframes popupIn {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.textpop {
    background: var(--popup-bg, var(--bg));
    padding: 24px;
    border-radius: 28px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    margin: 0 auto;
    color: var(--popup-text, var(--text));
}

.popicloud {
    border-radius: 12px;
    display: inline-block;
    width: 60px;
    height: 60px;
}

.textpop h3 {
    font-size: 20px;
    margin: 0 0 16px;
    font-weight: 600;
}

.parrapop {
    display: inline-block;
    font-size: 15px;
    width: calc(100% - 80px);
    margin: 0 0 0 14px;
    vertical-align: top;
    line-height: 1.4;
    text-align: left;
    color: var(--popup-text-secondary, var(--muted));
}

.popbutton {
    background: var(--popup-btn-bg, var(--apple-blue));
    border: none;
    border-radius: 14px;
    color: var(--popup-btn-text, #fff);
    padding: 14px;
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 0;
    width: 100%;
    cursor: pointer;
}

.popbutton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cerrpop {
    background: var(--popup-close-bg, rgba(255, 255, 255, 0.1));
    position: absolute;
    top: 16px;
    right: 16px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.cerrpop:hover {
    filter: brightness(0.9);
}

.cerrpop svg {
    width: 12px;
    height: 12px;
    color: var(--popup-close-icon, var(--muted));
    stroke: currentColor;
    fill: none;
    display: block;
}

@media (prefers-color-scheme: light) {
    :root {
        --popup-bg: #fff;
        --popup-text: #000;
        --popup-text-secondary: #666;
        --popup-close-bg: #e1e1e1;
        --popup-close-icon: #888;
        --popup-btn-bg: #0071e3;
        --popup-btn-text: #fff;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --popup-bg: #1e1e1e;
        --popup-text: #fff;
        --popup-text-secondary: #aaa;
        --popup-close-bg: #3a3a3c;
        --popup-close-icon: #999;
        --popup-btn-bg: #0071e3;
        --popup-btn-text: #fff;
    }
}
