/* ── CLICKaligners Custom Auth (Login, Registration, Lost Password) ── */

/* Exact Border Radius Token matching buttons and fields */
:root {
    --click-radius: 12px;
    --click-btn-dark: #23272f;
    --click-btn-dark-hover: #0f172a;
    --click-input-bg: #eef3fb;
    --click-input-bg-hover: #e6eef9;
    --click-input-bg-focus: #ffffff;
    --click-accent-blue: var(--ast-global-color-0);
}

/* Page container resets for full height below header (64.4px) - footer completely disabled */
.page-template-page-entering #primary,
.page-template-page-auth #primary,
.page-entering #primary,
.click-auth-page-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 64.4px) !important;
    min-height: calc(100vh - 64.4px) !important;
    max-height: calc(100vh - 64.4px) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.page-template-page-entering .site-content,
.page-template-page-entering .ast-container,
.page-template-page-auth .site-content,
.page-template-page-auth .ast-container,
.page-entering .site-content,
.page-entering .ast-container,
.click-auth-page .site-content,
.click-auth-page .ast-container,
.click-auth-page-wrapper .entry-content {
    margin: 0 auto !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: calc(100vh - 64.4px) !important;
    min-height: calc(100vh - 64.4px) !important;
    max-height: calc(100vh - 64.4px) !important;
    overflow: hidden !important;
}

/* Ensure logged in My-Account pages (edit-account, orders, etc.) have full natural scrolling */
body.woocommerce-account:not(.logged-out):not(.click-auth-page),
body.woocommerce-account:not(.logged-out):not(.click-auth-page) #primary,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .site-content,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .ast-container,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .entry-content,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .woocommerce,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .My-account__wrapper,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .My-account__main-content,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .woocommerce-MyAccount-content,
body.woocommerce-account:not(.logged-out):not(.click-auth-page) .click-edit-account-wrap {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Completely suppress footer on login / auth pages */
.page-template-page-entering footer,
.page-template-page-entering .site-footer,
.page-template-page-entering #colophon,
.page-template-page-auth footer,
.page-template-page-auth .site-footer,
.page-template-page-auth #colophon,
.page-entering footer,
.page-entering .site-footer,
.page-entering #colophon,
.click-auth-page footer,
.click-auth-page .site-footer,
.click-auth-page #colophon,
body.ast-no-footer footer,
body.ast-no-footer .site-footer,
body.ast-no-footer #colophon,
.click-auth-layout ~ footer,
.click-auth-layout ~ .site-footer,
.click-auth-page-wrapper ~ footer,
.click-auth-page-wrapper ~ .site-footer {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

/* ── Full Height & Width Auth Layout ── */
.click-auth-layout {
    width: 100% !important;
    height: calc(100vh - 64.4px) !important;
    min-height: calc(100vh - 64.4px) !important;
    max-height: calc(100vh - 64.4px) !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    padding: 16px 24px !important;
    box-sizing: border-box !important;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden !important;
    background: #f8fafc;
}

/* ── Header Policy Link on Auth Pages ── */
.click-header-right--guest {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.click-header-policy-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    text-decoration: none !important;
    line-height: 1.2;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.click-header-policy-link svg {
    color: #64748b;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.click-header-policy-link:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
    text-decoration: none !important;
    transform: translateY(-1px);
}

.click-header-policy-link:hover svg {
    color: var(--ast-global-color-0);
    transform: scale(1.08);
}

/* ── Card Container ── */
.click-auth-card {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    background: #ffffff !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden !important;
    padding: 14px !important;
    box-sizing: border-box !important;
    gap: 20px !important;
    align-items: stretch !important;
    animation: clickCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes clickCardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.985);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Visual Column (Left) ── */
.click-auth-visual-col {
    flex: 1 1 50% !important;
    width: 50% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    background: #080c14 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.click-auth-image-wrap {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    display: flex !important;
    overflow: hidden !important;
}

.click-auth-hero-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 20px !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    animation: clickHeroZoom 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.click-auth-visual-col:hover .click-auth-hero-img {
    transform: scale(1.02);
}

@keyframes clickHeroZoom {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Form Column (Right) ── */
.click-auth-form-col {
    flex: 1 1 50% !important;
    width: 50% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px 44px !important;
    box-sizing: border-box !important;
}

/* Subtle sleek custom scrollbar for form column */
.click-auth-form-col::-webkit-scrollbar {
    width: 5px;
}
.click-auth-form-col::-webkit-scrollbar-track {
    background: transparent;
}
.click-auth-form-col::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.click-auth-form-col::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.click-auth-form-inner {
    width: 100%;
    max-width: 430px;
    padding: 10px 0;
}

/* ── Typography & Headers ── */
.click-auth-header {
    margin-bottom: 22px;
}

.click-auth-title {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0 0 10px 0;
    transition: color 0.2s ease;
}

.click-auth-subtitle {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
}

/* Back Button with hover slide */
.click-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.click-back-btn svg {
    transition: transform 0.2s ease;
}

.click-back-btn:hover {
    color: #0f172a;
    transform: translateX(-4px);
}

.click-back-btn:hover svg {
    transform: translateX(-2px);
}

/* ── Form Controls & Groups ── */
.click-auth-form {
    display: flex;
    flex-direction: column;
}

.click-form-group {
    margin-bottom: 18px;
    position: relative;
}

.click-form-row {
    display: flex;
    gap: 14px;
}

.click-col-half {
    flex: 1;
    min-width: 0;
}

.click-form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.click-form-group:focus-within .click-form-label {
    color: var(--ast-global-color-0);
}

.click-req {
    color: #ef4444;
    font-weight: 700;
}

.click-label-optional {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 400;
}

/* ── Input Fields with EXACT border-radius matching button (12px) ── */
.click-form-input,
.click-auth-layout .click-form-input,
.click-auth-layout input.click-form-input,
.click-auth-layout input[type="text"],
.click-auth-layout input[type="email"],
.click-auth-layout input[type="password"],
.click-auth-layout input[type="tel"] {
    width: 100% !important;
    background: var(--click-input-bg) !important;
    border: 1.5px solid transparent !important;
    border-radius: var(--click-radius) !important;
    padding: 13px 16px !important;
    font-size: 14.5px !important;
    color: #0f172a !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    font-family: inherit !important;
}

.click-form-input::placeholder {
    color: #94a3b8;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.click-form-input:hover {
    background: var(--click-input-bg-hover) !important;
}

.click-form-input:focus {
    background: var(--click-input-bg-focus) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 2px 8px rgba(59, 130, 246, 0.06) !important;
    transform: translateY(-1px);
}

.click-form-input.is-invalid {
    border-color: #ef4444 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* Password Input with Animated Visibility Eye Toggle */
.click-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--click-radius);
}

.click-password-input {
    padding-right: 46px !important;
}

.click-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
    outline: none;
}

.click-password-toggle:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-50%) scale(1.12);
}

.click-password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* ── Checkbox (Terms) with animation ── */
.click-form-checkbox-group {
    margin: 4px 0 20px 0;
}

.click-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.click-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.click-checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.click-checkbox-input:checked + .click-checkbox-custom {
    background: var(--click-btn-dark);
    border-color: var(--click-btn-dark);
    transform: scale(1.05);
}

.click-checkbox-custom::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: none;
    margin-top: -2px;
}

.click-checkbox-input:checked + .click-checkbox-custom::after {
    display: block;
    animation: clickCheckPop 0.2s ease forwards;
}

@keyframes clickCheckPop {
    from {
        transform: rotate(45deg) scale(0);
    }
    to {
        transform: rotate(45deg) scale(1);
    }
}

.click-checkbox-label:hover .click-checkbox-custom {
    border-color: #94a3b8;
}

.click-link-inline {
    color: var(--click-accent-blue);
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.click-link-inline:hover {
    color: var(--ast-global-color-0);
    opacity: 0.9;
}

/* ── Submit Button with EXACT border-radius (12px) & micro-animations ── */
.click-form-actions {
    margin-top: 6px;
    margin-bottom: 16px;
}

.click-auth-submit-btn,
.click-auth-layout .click-auth-submit-btn,
.click-auth-layout button.click-auth-submit-btn {
    width: 100% !important;
    background: var(--click-btn-dark) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--click-radius) !important;
    padding: 14px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    font-family: inherit !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Shimmer highlight line on hover */
.click-auth-submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.click-auth-submit-btn:hover::after {
    left: 150%;
}

.click-auth-submit-btn:hover {
    background: var(--click-btn-dark-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2) !important;
}

.click-auth-submit-btn:active {
    transform: translateY(1px) scale(0.99) !important;
}

.click-auth-submit-btn--secondary {
    background: #f1f5f9 !important;
    color: #334155 !important;
    box-shadow: none !important;
    border-radius: var(--click-radius) !important;
}

.click-auth-submit-btn--secondary:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.click-auth-submit-btn.is-loading {
    opacity: 0.8 !important;
    pointer-events: none !important;
}

/* Spinner inside button */
.click-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: clickSpin 0.6s linear infinite;
    display: inline-block;
}

.click-auth-submit-btn--secondary .click-btn-spinner {
    border: 2px solid rgba(51, 65, 85, 0.2);
    border-top-color: #334155;
}

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

/* ── Secondary Links & Switchers ── */
.click-form-links {
    text-align: center;
    margin-bottom: 20px;
}

.click-link-subtle {
    font-size: 13.5px;
    color: var(--click-accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.click-link-subtle:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.click-auth-switch-box {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.click-link-accent {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--click-accent-blue);
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

.click-link-accent:hover {
    text-decoration: underline;
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ── Feedback Message Banner with drop animation ── */
.click-auth-alert {
    padding: 12px 16px;
    border-radius: var(--click-radius);
    font-size: 13.5px;
    line-height: 1.4;
    margin-bottom: 20px;
    animation: clickAlertPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.click-auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.click-auth-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

@keyframes clickAlertPop {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── View Transitions Animations ── */
.click-auth-view {
    display: block;
}

.click-auth-view.animate-in {
    animation: clickSlideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.click-auth-view.animate-in-back {
    animation: clickSlideInLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@keyframes clickSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Form Shake on Error */
.click-auth-form.is-shaking {
    animation: clickFormShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes clickFormShake {
    10%, 90% { transform: translateX(-3px); }
    20%, 80% { transform: translateX(5px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

/* ── Responsive Styling ── */
@media (max-width: 920px) {
    .page-template-page-entering .site-content,
    .page-template-page-entering #primary,
    .page-template-page-entering .ast-container,
    .page-template-page-auth .site-content,
    .page-template-page-auth #primary,
    .page-template-page-auth .ast-container,
    .page-entering .site-content,
    .page-entering #primary,
    .page-entering .ast-container,
    .click-auth-page .site-content,
    .click-auth-page #primary,
    .click-auth-page .ast-container,
    .click-auth-page-wrapper,
    .click-auth-layout {
        height: auto !important;
        min-height: calc(100vh - 64.4px) !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .click-auth-layout {
        padding: 14px 16px !important;
    }

    .click-auth-card {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        padding: 12px !important;
    }

    .click-auth-visual-col {
        width: 100% !important;
        flex: 0 0 260px !important;
        height: 260px !important;
        min-height: 260px !important;
        max-height: 260px !important;
    }

    .click-auth-form-col {
        width: 100% !important;
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 24px 16px !important;
    }

    .click-auth-title {
        font-size: 26px;
    }
}

@media (max-width: 540px) {
    /* Шапка: компактная ссылка на политику без иконки, прижата вправо */
    .click-header-right--guest {
        flex: 0 1 auto;
        min-width: 0;
        margin-left: auto;
        padding-left: 12px;
        justify-content: flex-end;
    }

    .click-header-policy-link {
        gap: 0;
        padding: 6px 10px;
        width: min-content;
        font-size: 11.5px;
        line-height: 1.25;
        justify-content: center;
        text-align: center;
        border-radius: 8px;
    }

    .click-header-policy-link svg {
        display: none;
    }

    .click-auth-layout {
        padding: 10px 8px !important;
    }

    .click-auth-card {
        border-radius: 18px !important;
        padding: 8px !important;
    }

    .click-auth-visual-col {
        flex: 0 0 200px !important;
        height: 200px !important;
        min-height: 200px !important;
        border-radius: 14px !important;
    }

    .click-auth-hero-img {
        border-radius: 14px !important;
    }

    .click-auth-form-col {
        padding: 18px 8px !important;
    }

    .click-form-row {
        flex-direction: column;
        gap: 0;
    }

    .click-auth-title {
        font-size: 23px;
    }
}
