/* =========================================================================
   Login v4 — full-screen scenic login page
   Loaded by: resources/views/partials/login_designs/v4.blade.php
   ------------------------------------------------------------------------
   Background image URL is injected via the --login-bg CSS variable from the
   blade file (so asset()/whitelabel logic can stay in PHP).
   ========================================================================= */

* { box-sizing: border-box; }

/* ===== Override auth layout for full-screen design ===== */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overscroll-behavior: none; /* prevents iOS/Android bounce without blocking scroll */
}

#app-login { display: none !important; }

#app {
    background: transparent !important;
    overflow: visible !important;
    min-height: 100svh;
    padding: 0 !important;
}

/* ===== Install-PWA / Facebook-in-app banners =====
   The auth layout puts these inside #app before .slash-content. Floated over
   the login as overlays so they can't push content taller than viewport. */
.installPWA-container,
.facebookApp-container {
    position: absolute;
    top: env(safe-area-inset-top, 0);
    left: 0;
    right: 0;
    z-index: 30; /* above language selector (20) */
    margin: 0 !important;
    padding: 0.6em 1em !important;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.installPWA-wrapper,
.facebookInApp-wrapper {
    pointer-events: auto;
    width: 100%;
    max-width: 420px;
    margin: 0 auto !important;
    padding: 0.7em 1em !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.85em;
    gap: 0.6em;
}

.installPWA-wrapper #install-pwa {
    font-size: 0.85em;
    white-space: nowrap;
}

.installPWA-wrapper #close-pwa-tab,
.facebookInApp-wrapper #close-facebookApp-tab {
    margin-right: 0 !important;
    font-size: 1em;
    color: #555;
    padding: 0 0.3em;
}

.installPWA-wrapper #addToHS-txt {
    padding: 0 !important;
    font-size: 0.78em;
    line-height: 1.35;
    flex: 1;
}

@media only screen and (max-width: 480px) {
    .installPWA-container,
    .facebookApp-container { padding: 0.5em 0.7em !important; }
    .installPWA-wrapper,
    .facebookInApp-wrapper {
        font-size: 0.8em;
        padding: 0.6em 0.8em !important;
    }
}

/* Hide install banner when running as standalone PWA (Android Chrome + iOS 16.4+). */
@media all and (display-mode: standalone) {
    .installPWA-container,
    .facebookApp-container { display: none !important; }
}
/* iOS <16.4 fallback — JS adds .is-standalone-pwa when navigator.standalone is true. */
body.is-standalone-pwa .installPWA-container,
body.is-standalone-pwa .facebookApp-container { display: none !important; }

/* Desktop / mouse devices — no need for "Add to Home Screen" prompt. */
@media (hover: hover) and (pointer: fine) {
    .installPWA-container,
    .facebookApp-container { display: none !important; }
}

.slash-content {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100svh;
}

/* ===== Layout wrappers ===== */
.login-wrapper {
    position: relative;
    min-height: 100svh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overscroll-behavior: none;
}

.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-image: var(--login-bg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.login-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.10) 35%,
        rgba(0, 0, 0, 0.30) 65%,
        rgba(0, 0, 0, 0.55) 100%
    );
}

.login-scroll-content {
    position: relative;
    z-index: 2;
    min-height: 100svh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2em 1.5em 0;
    overflow-anchor: none;
}

/* ===== Cloudflare Turnstile modal ===== */
.turnstile-modal-content {
    background: #fff;
    border-radius: 12px;
    border: none;
    padding: 1.5em 1em;
    text-align: center;
}
.turnstile-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
}
.turnstile-modal-title {
    margin: 0;
    font-size: 1rem;
    color: #333;
    text-transform: none;
}
#cf-turnstile-modal {
    width: 100%;
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#cf-turnstile-modal iframe {
    max-width: 100% !important;
}

/* Pushes the form down to reveal the scenic image */
.login-spacer {
    flex: 1;
    min-height: 21vh;
}

/* ===== Language selector ===== */
.v4-lang-switcher {
    position: absolute;
    top: env(safe-area-inset-top, 0);
    right: 0;
    z-index: 20;
    margin: 0.6em 0.8em;
    list-style: none;
    padding: 0;
}
@media (min-width: 600px) {
    /* Align with the right edge of the centered (max-width: 420px) form. */
    .v4-lang-switcher {
        right: calc(50% - 210px);
        margin-right: 0;
    }
}
.v4-lang-switcher .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.4em 0.7em;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: 'Nunito', sans-serif;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.v4-lang-switcher .nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff !important;
}
.v4-lang-switcher .flag {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.v4-lang-switcher .country-code { line-height: 1; }
.v4-lang-switcher .dropdown-menu {
    background: rgba(255, 255, 255, 0.96);
    border: none;
    border-radius: 12px;
    padding: 0.3em 0;
    margin-top: 0.4em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    min-width: 180px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.v4-lang-switcher .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.5em 1em;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
}
.v4-lang-switcher .dropdown-item:hover {
    background: rgba(64, 193, 192, 0.12);
    color: #000;
}
.v4-lang-switcher .dropdown-item .flag {
    width: 20px;
    height: 20px;
}

/* ===== Logo + tagline ===== */
.login-logo-section {
    text-align: center;
    margin-bottom: 0.3em;
}

.login-logo-img {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 0 16px rgba(64, 193, 192, 0.7));
    margin-bottom: 2px;
}

.login-brand-name {
    font-family: 'Prompt', 'Nunito', sans-serif;
    font-size: 2.8em;
    font-weight: 900;
    color: #fff;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4), 0 0 40px rgba(64, 193, 192, 0.3);
    margin: 0;
    line-height: 1;
}

.login-tagline {
    text-align: center;
    margin: -1.3em 0 0.2em;
}
.login-tagline h1 {
    font-family: 'Prompt', 'Nunito', sans-serif;
    font-size: 1em;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    margin: 0 0 0.1em;
}
.login-tagline .tagline-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 0.75em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.3px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* Animated loading text (currently disabled in HTML, kept for re-enable) */
.login-loading-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    margin: 0.4em 0 0.2em;
    font-style: italic;
    letter-spacing: 0.3px;
    min-height: 1.2em;
}
.loading-dots::after {
    content: '';
    animation: dots 2s steps(4, end) infinite;
}
@keyframes dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

.login-journey-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.80);
    text-align: center;
    margin-bottom: 0.6em;
    letter-spacing: 0.3px;
}

/* ===== Error notification ===== */
.error-noti {
    width: 100%;
    max-width: 420px;
    margin-bottom: 0.8em;
}
.alert.alert-danger {
    border-radius: 10px;
    padding: 0.8em 1em;
    font-size: 0.9em;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    border: none;
}

/* ===== Form ===== */
.login-form-container {
    width: 100%;
    max-width: 420px;
    margin: 0;
}

.form-input-group {
    margin-bottom: 0.5em;
    text-align: center;
}

.form-input {
    width: 100%;
    padding: 0.8em 1.2em;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    /* 16px minimum prevents iOS Safari from auto-zooming on focus */
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    color: #333;
    letter-spacing: 1.5px;
    text-transform: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.form-input::placeholder {
    color: #888;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.75em;
    font-weight: 500;
}
.form-input:focus {
    outline: none;
    border-color: rgba(64, 193, 192, 0.8);
    box-shadow: 0 4px 20px rgba(64, 193, 192, 0.3);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.97);
}

/* ===== Captcha ===== */
.custom-captcha {
    margin: 0.3em 0;
    display: flex;
    justify-content: center;
}
.captcha-verified {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
}

/* ===== Login button ===== */
.login-btn {
    width: 100%;
    padding: 0.85em;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    font-family: 'Prompt', 'Nunito', sans-serif;
    font-size: 0.85em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    display: block;
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.45);
    transition: all 0.3s ease;
    margin-top: 0.2em;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 172, 254, 0.55);
    background: linear-gradient(135deg, #5cb8ff 0%, #20f8ff 100%);
}
.login-btn:active {
    transform: translateY(0);
}

.login-btn-caption {
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.3em;
    letter-spacing: 0.3px;
}

/* ===== OR divider ===== */
.or-divider {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin: 0.6em 0 0.5em;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    font-size: 0.72em;
    letter-spacing: 2px;
}
.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.40);
}

/* ===== Social login ===== */
.social-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5em;
    margin-bottom: 0.3em;
}
.social-group a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.social-group a:hover {
    background: rgba(255, 255, 255, 0.30);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.social-group img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* ===== Forgot password ===== */
.forgot-password {
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-size: 0.74em;
    color: rgba(255, 255, 255, 0.85);
    margin: 0.5em 0 0.3em;
    letter-spacing: 0.3px;
}
.forgot-password a {
    color: #FFF1A4;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}
.forgot-password a:hover { color: #fff; }

/* ===== Register section ===== */
.register-section {
    text-align: center;
    margin-top: 0.5em;
}
.new-user-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72em;
    color: rgba(255, 255, 255, 0.80);
    letter-spacing: 1px;
    margin-bottom: 0.3em;
}
.register-btn {
    display: block;
    width: 100%;
    padding: 0.75em;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    background: transparent;
    color: #fff;
    font-family: 'Prompt', 'Nunito', sans-serif;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.register-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ===== Responsive ===== */
@media only screen and (max-width: 768px) {
    /* On mobile, let flex/space-evenly handle gaps — fixed 21vh spacer overflows shorter phones. */
    .login-spacer {
        flex: 0 0 auto;
        min-height: 0;
    }
    .login-scroll-content {
        padding: 1.8em 1.2em 0;
        justify-content: space-evenly;
    }
    .login-logo-img { width: 140px; }
    .login-brand-name { font-size: 2em; }
    .login-tagline h1 { font-size: 0.9em; }
    /* Pull tagline visually closer to the logo on mobile without changing the
       flex layout below it (position:relative shifts paint but not flow). */
    .login-tagline {
        margin: -1em 0 0.1em;
        position: relative;
        top: -3em;
    }
    .form-input-group { margin-bottom: 0.35em; }
    .login-form-container { width: 90%; }
    .or-divider { margin: 0.4em 0 0.35em; }
    .forgot-password { margin: 0.35em 0 0.2em; }
    .register-section { margin-top: 0.35em; }
}

@media only screen and (max-width: 480px) {
    .login-logo-img { width: 120px; }
    .login-brand-name {
        font-size: 1.7em;
        letter-spacing: 3px;
    }
    .login-tagline h1 { font-size: 0.78em; }
    .login-tagline .tagline-sub { font-size: 0.68em; }
    .form-input { padding: 0.65em 1em; }
    .login-form-container {
        width: 92%;
        margin: 0;
    }
    .login-btn,
    .register-btn {
        font-size: 0.75em;
        padding: 0.7em;
    }
    .login-btn-caption {
        font-size: 0.62em;
        margin-top: 0.2em;
    }
    .social-group {
        gap: 1.2em;
        margin-bottom: 0.2em;
    }
    .social-group a {
        width: 38px;
        height: 38px;
    }
    .social-group img {
        width: 18px;
        height: 18px;
    }
    .custom-captcha { margin: 0.1em 0; }
}

@media only screen and (max-width: 375px) {
    .login-logo-img { width: 105px; }
    .login-brand-name { font-size: 1.6em; }
    .login-tagline h1 { font-size: 0.75em; }
    .login-scroll-content { padding: 1.2em 1em 0; }
    .form-input { padding: 0.6em 0.9em; }
    .login-btn,
    .register-btn {
        font-size: 0.72em;
        padding: 0.65em;
    }
}


