/* ==========================================================================
   ProfilePal Brand Showcase Login Page
   ==========================================================================

   Design: Split-panel login with dark forest green showcase + clean white form
   Color system: Forest Green v2
   Fonts: Playfair Display (headings), Inter (body/labels)

   Table of Contents:
   1.  Layout Overrides (hide header/breadcrumb/footer)
   2.  Split Layout Container
   3.  Left Panel - Showcase
   4.  Left Panel - Content (home link, carousel, trust stat)
   5.  Right Panel - Form Container
   6.  Form Fields
   7.  Password Toggle
   8.  Submit Button
   9.  Social Login
   10. Links
   11. Trust Badges
   12. Field Errors
   13. Entrance Animations (@keyframes)
   14. Responsive - Tablet (max-width: 991px)
   15. Responsive - Mobile (max-width: 576px)
   16. RTL Support
   17. Reduced Motion
   ========================================================================== */


/* ==========================================================================
   1. Layout Overrides
   Hide standard layout chrome when the brand showcase login section is present.
   Uses :has() on body to scope overrides without JS.
   ========================================================================== */

body:has(.brand-showcase-login) .header-area,
body:has(.brand-showcase-login) .header-navigation,
body:has(.brand-showcase-login) .breadcrumbs-section,
body:has(.brand-showcase-login) footer,
body:has(.brand-showcase-login) .saas-footer,
body:has(.brand-showcase-login) .footer-area,
body:has(.brand-showcase-login) .footer-widget,
body:has(.brand-showcase-login) .back-to-top,
body:has(.brand-showcase-login) #WAButton,
body:has(.brand-showcase-login) .cookie,
body:has(.brand-showcase-login) .preloader {
    display: none !important;
}

body:has(.brand-showcase-login) {
    overflow: hidden;
    background: #f9fafb;
}

/* Reset any inherited padding/margin from the layout */
body:has(.brand-showcase-login) main,
body:has(.brand-showcase-login) .main-content {
    padding: 0;
    margin: 0;
}


/* ==========================================================================
   2. Split Layout Container
   ========================================================================== */

.brand-showcase-login {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* ==========================================================================
   3. Left Panel - Showcase
   Dark forest green gradient with particle canvas and overlay for depth.
   ========================================================================== */

.showcase-panel {
    width: 55%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0d1a0d 0%, #1a2e1a 40%, #2d4a2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Particle canvas - positioned behind content, drawn by JS */
.showcase-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Radial gradient overlay for atmospheric depth */
.showcase-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(122, 185, 41, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(45, 74, 45, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Subtle vignette around edges */
.showcase-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.25) 100%);
    pointer-events: none;
}


/* ==========================================================================
   4. Left Panel - Content
   Home link (logo), slideshow carousel, and trust stat. Vertically distributed with flex.
   ========================================================================== */

.showcase-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    text-align: center;
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

/* Home Link (Logo) */
.showcase-home-link {
    display: inline-block;
    text-decoration: none;
    margin-bottom: auto;
    padding-top: 60px;
    animation: loginFadeInLeft 0.8s ease-out 0.2s both;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.showcase-home-link:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.showcase-home-link:focus-visible {
    outline: 2px solid rgba(122, 185, 41, 0.5);
    outline-offset: 4px;
    border-radius: 4px;
}

.showcase-logo-img {
    max-width: 200px;
    height: auto;
    filter: brightness(1.1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Slideshow Carousel */
.showcase-carousel {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
    padding: 0 20px;
    max-width: 1120px;
    width: 100%;
    animation: loginFadeInLeft 0.8s ease-out 0.4s both;
}

/* Carousel Slides - crossfade transition */
.carousel-slide {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    text-align: center;
    padding: 0 20px;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    top: auto;
    transform: none;
}

/* Slide Image */
.slide-image {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.slide-image img {
    width: 100%;
    min-width: 600px;
    max-height: 600px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Slide Quote */
.slide-quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: 0.01em;
}

/* Slide Author */
.slide-author {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(122, 185, 41, 0.7);
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.02em;
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active,
.carousel-dot:hover {
    background: #7ab929;
    transform: scale(1.2);
}

.carousel-dot:focus-visible {
    outline: 2px solid rgba(122, 185, 41, 0.5);
    outline-offset: 2px;
}

/* Trust Stat */
.showcase-trust-stat {
    margin-top: auto;
    padding-bottom: 48px;
    animation: loginFadeInLeft 0.8s ease-out 0.6s both;
}

.showcase-trust-stat p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    letter-spacing: 0.03em;
}


/* ==========================================================================
   5. Right Panel - Form Container
   Clean white/off-white panel with centered form.
   ========================================================================== */

.login-form-panel {
    width: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 40px 24px;
    overflow-y: auto;
    flex-shrink: 0;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 0 8px;
}

/* Back to Home button */
.login-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 24px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.25s ease;
    background: transparent;
}
.login-home-btn:hover {
    color: #7ab929;
    background: rgba(122, 185, 41, 0.08);
    transform: translateX(-2px);
}
.login-home-btn i {
    font-size: 12px;
    transition: transform 0.25s ease;
}
.login-home-btn:hover i {
    transform: translateX(-3px);
}

.login-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    line-height: 1.2;
    animation: loginFadeInUp 0.7s ease-out 0.3s both;
}

.login-title:not(:has(+ .login-subtitle)) {
    margin-bottom: 36px;
}

.login-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 32px;
    line-height: 1.5;
    animation: loginFadeInUp 0.7s ease-out 0.4s both;
}

.login-form {
    animation: loginFadeInUp 0.7s ease-out 0.45s both;
}


/* ==========================================================================
   6. Form Fields
   ========================================================================== */

.login-field {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.field-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    background: #ffffff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    line-height: 1.5;
}

.field-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.field-input:focus {
    border-color: #7ab929;
    box-shadow: 0 0 0 3px rgba(122, 185, 41, 0.1);
}

.field-input:hover:not(:focus) {
    border-color: #b0b8c1;
}

/* reCAPTCHA field spacing */
.recaptcha-field {
    margin-bottom: 24px;
}

.recaptcha-field .g-recaptcha {
    transform-origin: left top;
}


/* ==========================================================================
   7. Password Toggle
   Eye icon inside password field.
   ========================================================================== */

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .field-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 6px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #7ab929;
}

.password-toggle:focus {
    outline: 2px solid rgba(122, 185, 41, 0.4);
    outline-offset: 2px;
    border-radius: 4px;
}


/* ==========================================================================
   8. Submit Button
   Full-width green gradient button with arrow that slides on hover.
   ========================================================================== */

.login-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #6aa522 0%, #7ab929 50%, #8bc34a 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.5;
    letter-spacing: 0.01em;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.5s ease;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(122, 185, 41, 0.4);
}

.login-submit-btn:hover::before {
    left: 100%;
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(122, 185, 41, 0.3);
}

.login-submit-btn:focus-visible {
    outline: 2px solid #7ab929;
    outline-offset: 2px;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.login-submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-spinner {
    position: relative;
    z-index: 1;
}

.btn-spinner i {
    font-size: 16px;
}


/* ==========================================================================
   9. Social Login
   Divider line with centered text + circular social buttons.
   ========================================================================== */

.social-divider {
    display: flex;
    align-items: center;
    margin: 28px 0 24px;
    gap: 16px;
    animation: loginFadeInUp 0.7s ease-out 0.6s both;
}

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

.social-divider span {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
    font-weight: 400;
}

.social-login-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    animation: loginFadeInUp 0.7s ease-out 0.7s both;
}

.social-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    padding: 0;
    line-height: 1;
}

.social-btn:hover {
    border-color: #7ab929;
    color: #7ab929;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.social-btn:active {
    transform: translateY(0);
}

.social-btn:focus-visible {
    outline: 2px solid rgba(122, 185, 41, 0.4);
    outline-offset: 2px;
}

/* Specific social icon colors on hover */
.social-btn[aria-label*="Apple"]:hover {
    color: #000000;
    border-color: #000000;
}

.social-btn[aria-label*="Google"]:hover {
    color: #4285f4;
    border-color: #4285f4;
}

.social-btn[aria-label*="Facebook"]:hover {
    color: #1877f2;
    border-color: #1877f2;
}


/* ==========================================================================
   10. Links
   ========================================================================== */

.login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    animation: loginFadeInUp 0.7s ease-out 0.8s both;
}

.link-forgot {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-forgot:hover {
    color: #7ab929;
    text-decoration: none;
}

.link-signup {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #7ab929;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-signup:hover {
    color: #6aa522;
    text-decoration: none;
}


/* ==========================================================================
   11. Trust Badges
   ========================================================================== */

.login-trust-badges {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #e5e7eb;
    animation: loginFadeInUp 0.7s ease-out 0.9s both;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af;
    font-weight: 500;
}

.trust-badge i {
    color: #7ab929;
    font-size: 13px;
}


/* ==========================================================================
   12. Field Errors
   ========================================================================== */

/* Reset Success Message */
.reset-success-msg {
    text-align: center;
    padding: 32px 0;
    animation: loginFadeInUp 0.6s ease-out both;
}
.reset-success-msg .success-icon {
    font-size: 48px;
    color: #7ab929;
    margin-bottom: 16px;
}
.reset-success-msg p {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 0;
}

.field-error {
    color: #ef4444;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.4;
}


/* ==========================================================================
   13. Entrance Animations (@keyframes)
   Staggered CSS-only animations for page load.
   ========================================================================== */

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

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


/* ==========================================================================
   14. Responsive - Tablet (max-width: 991px)
   Stack panels vertically. Showcase becomes compact header strip.
   ========================================================================== */

@media (max-width: 991px) {
    body:has(.brand-showcase-login) {
        overflow-y: auto;
    }

    .brand-showcase-login {
        flex-direction: column;
    }

    .showcase-panel {
        width: 100%;
        min-height: 35vh;
        max-height: 40vh;
    }

    .showcase-content {
        min-height: 35vh;
        padding: 40px 32px;
    }

    .showcase-home-link {
        padding-top: 24px;
    }

    .showcase-logo-img {
        max-width: 160px;
    }

    .showcase-carousel {
        min-height: 140px;
        padding: 0 16px;
    }

    .slide-image {
        width: 90%;
    }
    .slide-image img {
        min-width: unset;
        max-height: 220px;
    }

    .slide-quote {
        font-size: 15px;
    }

    .carousel-dots {
        margin-top: 16px;
    }

    .showcase-trust-stat {
        padding-bottom: 24px;
    }

    .login-form-panel {
        width: 100%;
        padding: 40px 24px;
        min-height: 60vh;
    }

    .login-form-wrapper {
        max-width: 420px;
    }
}


/* ==========================================================================
   15. Responsive - Mobile (max-width: 576px)
   Further compact everything for small screens.
   ========================================================================== */

@media (max-width: 576px) {
    .showcase-panel {
        min-height: 28vh;
        max-height: 32vh;
    }

    .showcase-content {
        min-height: 28vh;
        padding: 28px 24px;
    }

    .showcase-home-link {
        padding-top: 16px;
    }

    .showcase-logo-img {
        max-width: 140px;
    }

    .showcase-carousel {
        min-height: 120px;
        padding: 0 12px;
        max-width: 300px;
    }

    .slide-image {
        width: 95%;
    }
    .slide-image img {
        min-width: unset;
        max-height: 180px;
        border-radius: 8px;
    }

    .slide-quote {
        font-size: 14px;
        line-height: 1.6;
    }

    .slide-author {
        font-size: 12px;
    }

    /* Ensure dots are tappable on touch devices (44px min touch target) */
    .carousel-dot {
        width: 10px;
        height: 10px;
        padding: 0;
        position: relative;
    }
    .carousel-dot::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 44px;
        height: 44px;
    }

    .showcase-trust-stat {
        padding-bottom: 16px;
    }

    .showcase-trust-stat p {
        font-size: 12px;
    }

    .login-form-panel {
        padding: 32px 20px;
    }

    .login-form-wrapper {
        padding: 0 4px;
    }

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

    .field-input {
        padding: 11px 14px;
        font-size: 16px; /* prevent iOS zoom on focus */
    }

    .login-submit-btn {
        padding: 13px 20px;
        font-size: 15px;
    }

    .social-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 16px;
    }

    .social-login-buttons {
        gap: 14px;
    }

    .login-links {
        font-size: 13px;
    }

    .link-forgot,
    .link-signup {
        font-size: 13px;
    }

    .login-trust-badges {
        gap: 20px;
        margin-top: 28px;
        padding-top: 24px;
    }

    .trust-badge {
        font-size: 10px;
        letter-spacing: 0.6px;
    }
}

/* Extra-small screens */
@media (max-width: 380px) {
    .showcase-panel {
        min-height: 24vh;
    }

    .showcase-content {
        min-height: 24vh;
        padding: 20px 16px;
    }

    .showcase-carousel {
        display: none; /* hide carousel to save vertical space */
    }

    .login-form-wrapper {
        padding: 0;
    }

    .login-trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}


/* ==========================================================================
   16. RTL Support
   Mirror layout direction: showcase on right, form on left.
   Mirror all directional properties.
   ========================================================================== */

[dir="rtl"] .brand-showcase-login {
    flex-direction: row-reverse;
}

[dir="rtl"] .password-input-wrapper .field-input {
    padding-right: 16px;
    padding-left: 48px;
}

[dir="rtl"] .password-toggle {
    right: auto;
    left: 12px;
}

[dir="rtl"] .btn-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .login-submit-btn:hover .btn-arrow {
    transform: scaleX(-1) translateX(4px);
}

[dir="rtl"] .login-links {
    flex-direction: row-reverse;
}

/* RTL animation: fade from right instead of left */
[dir="rtl"] .showcase-home-link,
[dir="rtl"] .showcase-carousel,
[dir="rtl"] .showcase-trust-stat {
    animation-name: loginFadeInRight;
}

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

/* RTL reCAPTCHA origin */
[dir="rtl"] .recaptcha-field .g-recaptcha {
    transform-origin: right top;
}

/* RTL responsive: stacked layout reverts to column (no row-reverse) */
@media (max-width: 991px) {
    [dir="rtl"] .brand-showcase-login {
        flex-direction: column;
    }
}


/* ==========================================================================
   17. Reduced Motion
   Disable all animations and transitions for users who prefer reduced motion.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .showcase-home-link,
    .showcase-carousel,
    .showcase-trust-stat,
    .login-title,
    .login-form,
    .social-divider,
    .social-login-buttons,
    .login-links,
    .login-trust-badges {
        animation: none !important;
    }

    .field-input,
    .password-toggle,
    .login-submit-btn,
    .login-submit-btn::before,
    .btn-arrow,
    .social-btn,
    .link-forgot,
    .link-signup,
    .showcase-home-link,
    .carousel-slide,
    .carousel-dot {
        transition: none !important;
    }

    .login-submit-btn:hover {
        transform: none;
    }

    .login-submit-btn:hover .btn-arrow {
        transform: none;
    }

    .social-btn:hover {
        transform: none;
    }

    .showcase-home-link:hover {
        transform: none;
    }

    .carousel-dot.active,
    .carousel-dot:hover {
        transform: none;
    }
}
