/* =============================================================================
   FILE: assets/css/sso/ccl-sso-portal.css
   MODULE: CCL SSO - Liquid Glass Auth Shell Styles
   ============================================================================= */

/* Anti-FOUC: instantly hide default WooCommerce auth layout before JS remounts it. */
body.woocommerce-account:not(.logged-in) .woocommerce {
    display: none !important;
}

body.woocommerce-account:not(.logged-in) {
    overflow: hidden !important;
}

/* ==========================================================================
   LIGHT MODE BASE
   ========================================================================== */

.ccl-sso-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8fafc !important;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    opacity: 0;
    animation: cclBgFadeIn 0.4s ease-out forwards;
}

@keyframes cclBgFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ccl-account-card {
    width: 100% !important;
    max-width: 420px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    padding: 45px 40px !important;
    border-radius: 24px !important;
    box-sizing: border-box !important;
    margin: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: cclCardReveal 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s forwards;
    transition:
        max-width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        padding 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ccl-account-card.is-expanded {
    max-width: 880px !important;
}

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

/* Header & titles */
.ccl-card-logo-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.ccl-card-logo {
    max-width: 140px;
    height: auto;
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.ccl-card-header {
    text-align: center;
    font-weight: 800;
    font-size: 13px;
    color: #475569;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ccl-account-card h2 {
    display: none !important;
}

/* Modern text switcher */
.ccl-sso-switcher {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ccl-sso-tab {
    background: transparent !important;
    border: none !important;
    padding: 0 0 12px 0;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.ccl-sso-tab:hover {
    color: #0f172a;
}

.ccl-sso-tab.active {
    color: #4f46e5;
    font-weight: 900;
}

.ccl-sso-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #4f46e5;
    box-shadow: 0 -2px 8px rgba(79, 70, 229, 0.4);
}

/* Smooth form transitions */
.ccl-form-section {
    display: none;
    width: 100% !important;
}

.ccl-form-section.active {
    display: block !important;
    animation: cclSlideUp 0.3s ease-out;
}

@keyframes cclSlideUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inputs */
.ccl-account-card label {
    font-weight: 700 !important;
    color: #475569 !important;
    font-size: 12px !important;
    margin-bottom: 8px !important;
    display: block;
}

.ccl-account-card input.input-text {
    width: 100% !important;
    padding: 14px 16px !important;
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    color: #0f172a !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s ease;
}

.ccl-account-card input.input-text:focus {
    background: #ffffff !important;
    border-color: #4f46e5 !important;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(79, 70, 229, 0.15) !important;
    outline: 0;
}

/* Button override */
.ccl-account-card .button {
    width: 100% !important;
    margin-top: 15px;
    background: linear-gradient(135deg, #6366f1, #4338ca) !important;
    color: #fff !important;
    padding: 16px !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow:
        0 6px 15px rgba(79, 70, 229, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s ease;
}

.ccl-account-card .button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(79, 70, 229, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.4) !important;
}

/* Links & checkboxes */
.ccl-account-card a {
    color: #4f46e5;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: color 0.2s;
}

.ccl-account-card a:hover {
    filter: brightness(1.2);
}

.ccl-account-card .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}

/* Registration layout & perks sidebar */
.ccl-reg-layout {
    display: flex;
    gap: 45px;
}

.ccl-reg-form-col {
    flex: 1;
    min-width: 300px;
}

.ccl-reg-perks-col {
    flex: 1;
    display: none;
    opacity: 1;
    background: rgba(255, 255, 255, 0.5);
    padding: 45px 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
}

.is-expanded .ccl-reg-perks-col {
    display: block !important;
    animation: cclPerkReveal 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes cclPerkReveal {
    0% {
        opacity: 0;
        transform: translateX(10px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.ccl-perk-header {
    margin: 0 0 8px 0;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1.5px;
    color: #0f172a;
}

.ccl-perk-sub {
    margin: 0 0 35px 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.ccl-perk-item {
    display: flex;
    gap: 20px;
    margin-bottom: 35px;
}

.ccl-perk-item:last-child {
    margin-bottom: 0;
}

.ccl-perk-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.ccl-perk-text h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ccl-perk-text p {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.ccl-perk-1 {
    color: #6366f1;
}

.ccl-perk-2 {
    color: #10b981;
}

.ccl-perk-3 {
    color: #f59e0b;
}

/* Form grid fixes */
.ccl-account-card .form-row-first,
.ccl-account-card .form-row-last {
    width: 100% !important;
    float: none !important;
    margin-bottom: 15px !important;
}

.ccl-account-card p.form-row {
    margin-bottom: 18px !important;
}

@media (min-width: 480px) {
    .ccl-account-card .form-row-first,
    .ccl-account-card .form-row-last {
        width: 48% !important;
        float: left !important;
    }

    .ccl-account-card .form-row-last {
        float: right !important;
    }
}

@media (max-width: 800px) {
    .ccl-reg-layout {
        flex-direction: column;
        gap: 25px;
    }

    .ccl-account-card.is-expanded {
        padding: 30px 20px !important;
    }

    .ccl-reg-perks-col {
        padding: 30px 25px;
    }
}

/* ==========================================================================
   DARK MODE OVERRIDE
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ccl-sso-wrapper {
        background: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 70%) !important;
    }

    .ccl-account-card {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow:
            inset 0 1px 1px rgba(255, 255, 255, 0.1),
            0 25px 50px -12px rgba(0, 0, 0, 0.8) !important;
    }

    .ccl-card-header {
        color: #e2e8f0;
    }

    .ccl-sso-switcher {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .ccl-sso-tab {
        color: #94a3b8;
    }

    .ccl-sso-tab:hover {
        color: #f8fafc;
    }

    .ccl-sso-tab.active {
        color: #818cf8;
    }

    .ccl-sso-tab.active::after {
        background: #818cf8;
        box-shadow: 0 -2px 8px rgba(129, 140, 248, 0.6);
    }

    .ccl-account-card label {
        color: #94a3b8 !important;
    }

    .ccl-account-card input.input-text {
        background: rgba(0, 0, 0, 0.2) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: #f8fafc !important;
    }

    .ccl-account-card input.input-text:focus {
        background: rgba(0, 0, 0, 0.4) !important;
        border-color: #818cf8 !important;
        box-shadow:
            inset 0 2px 4px rgba(0, 0, 0, 0.2),
            0 0 0 3px rgba(129, 140, 248, 0.2) !important;
    }

    .ccl-account-card .woocommerce-form-login__rememberme {
        color: #cbd5e1;
    }

    .ccl-account-card a {
        color: #818cf8;
    }

    .ccl-reg-perks-col {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .ccl-perk-header {
        color: #f8fafc;
    }

    .ccl-perk-sub {
        color: #94a3b8;
    }

    .ccl-perk-text h4 {
        color: #f8fafc;
    }

    .ccl-perk-text p {
        color: #94a3b8;
    }

    .ccl-perk-icon.ccl-perk-1 {
        color: #818cf8;
    }

    .ccl-perk-icon.ccl-perk-2 {
        color: #34d399;
    }

    .ccl-perk-icon.ccl-perk-3 {
        color: #fbbf24;
    }
}