/* CardVerse — Modal global de autenticación */

.cv-auth-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cv-auth-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.cv-auth-modal {
    position: fixed;
    z-index: 1090;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    width: calc(100% - 2rem);
    max-width: 900px;
    max-height: calc(100vh - 2rem);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(124, 58, 237, 0.12);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.cv-auth-modal.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

body.cv-auth-open {
    overflow: hidden;
}

.cv-auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #444;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.cv-auth-close:hover {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.cv-auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
    max-height: calc(100vh - 2rem);
}

.cv-auth-panel--form {
    padding: 2rem 2rem 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cv-auth-panel--illus {
    background: linear-gradient(180deg, #faf7ff, #f5f0ff);
    border-left: 1px solid rgba(124, 58, 237, 0.08);
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-auth-header {
    margin-bottom: 1.25rem;
}

.cv-auth-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #111;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.cv-auth-sub {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cv-auth-social {
    margin-bottom: 0.75rem;
}

.cv-auth-google-mount {
    min-height: 44px;
}

.cv-auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.cv-auth-btn--email {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #111;
}

.cv-auth-btn--email:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cv-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0;
    color: #9ca3af;
    font-size: 0.78rem;
}

.cv-auth-divider::before,
.cv-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.cv-auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.cv-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cv-auth-field > span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.cv-auth-field input[type="text"],
.cv-auth-field input[type="email"],
.cv-auth-field input[type="password"] {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cv-auth-field input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.cv-auth-input-wrap {
    position: relative;
}

.cv-auth-input-wrap > i.fa-envelope {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.cv-auth-input-wrap input {
    padding-right: 2.5rem;
}

.cv-auth-eye {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #9ca3af;
    padding: 0.35rem;
    cursor: pointer;
}

.cv-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cv-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #555;
    margin: 0;
    cursor: pointer;
}

.cv-auth-check--terms {
    align-items: flex-start;
    line-height: 1.4;
}

.cv-auth-link,
.cv-auth-link-inline {
    border: none;
    background: none;
    padding: 0;
    color: #7c3aed;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

.cv-auth-link:hover,
.cv-auth-link-inline:hover {
    text-decoration: underline;
}

.cv-auth-submit {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    margin-top: 0.25rem;
}

.cv-auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.cv-auth-submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.cv-auth-switch {
    text-align: center;
    margin: 1rem 0 0;
    font-size: 0.88rem;
    color: #666;
}

.cv-auth-view {
    animation: cvAuthFade 0.3s ease;
}

.cv-auth-view[hidden] {
    display: none !important;
}

@keyframes cvAuthFade {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.cv-auth-otp {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}

.cv-auth-otp-digit {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
}

.cv-auth-otp-digit:focus {
    border-color: #7c3aed;
    outline: none;
}

.cv-auth-resend {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin: 0.5rem 0 0;
}

.cv-auth-secure {
    margin-top: auto;
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.cv-auth-illus-inner {
    text-align: center;
    max-width: 340px;
}

.cv-auth-illus-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.cv-auth-illus-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    color: #111;
}

.cv-auth-illus-text {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.cv-auth-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
}

.cv-auth-benefits li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0;
    font-size: 0.88rem;
    color: #444;
    font-weight: 600;
}

.cv-auth-benefit-ico {
    width: 28px;
    text-align: center;
}

.cv-auth-illus-img {
    width: 100%;
    max-width: 360px;
    height: auto;
    animation: cvAuthFloat 4s infinite ease-in-out;
    mix-blend-mode: screen;
    filter: drop-shadow(0 12px 28px rgba(124, 58, 237, 0.2));
}

@keyframes cvAuthFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cv-auth-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: grid;
    place-items: center;
    z-index: 10;
}

.cv-auth-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ede9fe;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: cvAuthSpin 0.7s linear infinite;
}

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

/* Header guest auth buttons */
.store-auth-btns {
    display: none;
    align-items: center;
    gap: 0.35rem;
}

@media (min-width: 992px) {
    .store-auth-btns {
        display: flex;
    }
}

.store-auth-btn {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.store-auth-btn--ghost {
    background: transparent;
    color: #333;
}

.store-auth-btn--ghost:hover {
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
}

.store-auth-btn--primary {
    background: #7c3aed;
    color: #fff;
}

.store-auth-btn--primary:hover {
    background: #6d28d9;
}

@media (max-width: 575.98px) {
    .cv-auth-layout {
        grid-template-columns: 1fr;
    }

    .cv-auth-panel--illus {
        display: none;
    }

    .cv-auth-panel--form {
        padding: 1.5rem 1.25rem 1rem;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .cv-auth-layout {
        grid-template-columns: 3fr 2fr;
    }
}

@media (max-width: 991.98px) {
    .cv-auth-panel--form {
        padding: 1.5rem 1.25rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .cv-auth-modal {
        width: calc(100% - 1rem);
        border-radius: 20px;
    }

    .cv-auth-title {
        font-size: 1.35rem;
    }

    .cv-auth-otp-digit {
        width: 38px;
        height: 46px;
        font-size: 1.15rem;
    }
}

body.cv-session-open {
    overflow: hidden;
}

/* —— Sesión caducada —— */
.cv-session-expired-backdrop {
    position: fixed;
    inset: 0;
    z-index: 11050;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cv-session-expired-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.cv-session-expired {
    position: fixed;
    inset: 0;
    z-index: 11060;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cv-session-expired.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cv-session-expired-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 22px;
    padding: 2rem 1.75rem 1.5rem;
    text-align: center;
    box-shadow:
        0 28px 60px rgba(15, 23, 42, 0.22),
        0 10px 24px rgba(124, 58, 237, 0.14);
    transform: translateY(12px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.cv-session-expired.is-open .cv-session-expired-card {
    transform: translateY(0) scale(1);
}

.cv-session-expired-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    color: #7c3aed;
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
    box-shadow: inset 0 0 0 1px #ddd6fe;
}

.cv-session-expired-title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}

.cv-session-expired-text {
    margin: 0 0 1.35rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #64748b;
}

.cv-session-expired-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cv-session-expired-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(124, 58, 237, 0.34);
}
