/* Import base styles */
@import url('base.css');

body {
    background-color: #f8f9ff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.auth-page {
    background-image: url("img/lastapp_sign_in_bg.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.container {
    background: none !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: row;
    width: 680px;
    /* base: medium desktop ~1280px */
    min-height: 440px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 16px !important;
    overflow: hidden;
    border-radius: 20px;
    margin: 20px;
    max-width: 100%;
}

.blue-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
    background-image: url("img/lastapp_sign_in_color.jpg");
    background-size: cover;
    background-position: center;
    border-radius: 20px 0 0 20px;
    color: white;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.blue-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.blue-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.logo-container {
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo {
    width: 80px;
    height: 80px;
    background-color: white;
    border-radius: 20px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    margin-left: 10%;
}

.logo span {
    font-size: 38px;
    font-weight: 700;
}

.app-name {
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

img.app-name {
    width: auto;
    height: 37px;
    margin-bottom: 5px;
    filter: brightness(0) invert(1);
}

.blue-tagline {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 28px;
    opacity: 0.9;
}

.welcome-text {
    margin: 0;
}

.welcome-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 18px;
}

.welcome-text p {
    font-size: 13px;
    line-height: 1.6;
}

.auth-container {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 44px;
    overflow: hidden;
    align-items: center;
    background-color: white;
}

/* Shake animation now from base.css */

.auth-container h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    text-align: center;
}

.auth-container>p {
    color: #666;
    font-size: 13px;
    margin-bottom: 24px;
    text-align: center;
}


/* ── Large desktop (1440px+) ─────────────────────────────────────────────── */
@media (min-width: 1281px) {
    .container {
        width: 780px;
        min-height: 490px;
    }

    .blue-container {
        padding: 38px;
    }

    .logo {
        width: 92px;
        height: 92px;
        border-radius: 22px;
        margin-left: 12%;
    }

    .logo span {
        font-size: 44px;
    }

    img.app-name {
        height: 37px;
    }

    .app-name {
        font-size: 30px;
    }

    .blue-tagline {
        font-size: 15px;
        margin-bottom: 36px;
    }

    .logo-container {
        margin-bottom: 36px;
    }

    .welcome-text h2 {
        font-size: 22px;
        margin-bottom: 22px;
    }

    .welcome-text p {
        font-size: 14px;
    }

    .auth-container {
        padding: 38px 56px;
    }

    .auth-container h1 {
        font-size: 26px;
        margin-bottom: 10px;
    }

    .auth-container>p {
        font-size: 14px;
        margin-bottom: 28px;
    }
}


/* ── Small desktop (13" laptops, ~969–1280px wide) ──────────────────────── */
@media (min-width: 969px) and (max-width: 1280px) {
    .container {
        width: 620px;
        min-height: 410px;
    }

    .blue-container {
        padding: 26px;
    }

    .logo {
        width: 68px;
        height: 68px;
        margin-left: 8%;
    }

    .logo span {
        font-size: 32px;
    }

    img.app-name {
        height: 37px;
    }

    .app-name {
        font-size: 22px;
    }

    .blue-tagline {
        font-size: 13px;
        margin-bottom: 22px;
    }

    .logo-container {
        margin-bottom: 22px;
    }

    .welcome-text h2 {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .welcome-text p {
        font-size: 12px;
    }

    .auth-container {
        padding: 26px 32px;
    }

    .auth-container h1 {
        font-size: 21px;
    }

    .auth-container>p {
        font-size: 12px;
        margin-bottom: 18px;
    }
}


/* ── Tablet (≤968px) ─────────────────────────────────────────────────────── */
@media (max-width: 968px) {
    .container {
        flex-direction: column;
        width: 90%;
        max-width: 500px;
        margin: 20px auto;
    }

    .blue-container {
        border-radius: 20px 20px 0 0;
        padding: 30px 20px;
        min-height: 320px;
    }

    .auth-container {
        padding: 30px 25px;
    }

    .welcome-text {
        max-width: 100%;
    }

    .logo {
        width: 80px;
        height: 80px;
    }

    .logo span {
        font-size: 36px;
    }

    .app-name {
        font-size: 26px;
    }
}

/* ── Small mobile (≤576px) ───────────────────────────────────────────────── */
@media (max-width: 576px) {
    .container {
        width: 95%;
        margin: 15px auto;
        min-height: auto;
    }

    .blue-container {
        padding: 25px 15px;
        min-height: 280px;
    }

    .blue-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 240px;
    }

    .logo-container {
        margin-bottom: 30px;
    }

    .logo {
        width: 70px;
        height: 70px;
    }

    .logo span {
        font-size: 30px;
    }

    .app-name {
        font-size: 24px;
    }

    .blue-tagline {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .welcome-text h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .welcome-text p {
        font-size: 14px;
    }

    .auth-container {
        padding: 20px 15px;
    }

    .auth-container h1 {
        font-size: 24px;
    }

    .auth-container>p {
        font-size: 14px;
        margin-bottom: 20px;
    }
}

/* ── Tiny screens (≤350px) ───────────────────────────────────────────────── */
@media (max-width: 350px) {
    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .blue-container {
        border-radius: 0;
        min-height: 260px;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    .logo span {
        font-size: 26px;
    }

    .welcome-text h2 {
        font-size: 18px;
    }

    .welcome-text p {
        font-size: 13px;
    }

    .auth-container h1 {
        font-size: 22px;
    }
}

/* fadeIn and spin animations now from base.css */

/* ── Mobile background swap (≤768px) ─────────────────────────────────────── */
@media (max-width: 768px) {

    .auth-page .container,
    .applogin-container {
        background-image: url(img/mobile_sign_in_bg.jpg) !important;
        background-size: cover !important;
        background-position: center !important;
    }

    .desktop .auth-page .container,
    .desktop .applogin-container {
        background-image: url(img/site_login_bg.jpg) !important;
    }

    .blue-container {
        background: none !important;
    }
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ── Sign-in buttons container ───────────────────────────────────────────── */
.signin-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
}


/* ── Desktop state cards (success / error) ───────────────────────────────── */
.desktop-state-card {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 32px;
    text-align: center;
    max-width: 360px;
    margin: 0 auto;
    background: #292929;
}

.desktop-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.desktop-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.desktop-state-msg {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.75;
}

#desktop-login-success-msg,
#desktop-login-error-msg {
    color: white;
}

#desktop-login-success .desktop-state-icon {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

#desktop-login-success .desktop-state-title {
    color: white;
}

#desktop-login-error .desktop-state-icon {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

#desktop-login-error .desktop-state-title {
    color: white;
}


/* ── Desktop app-specific overrides (.desktop class) ────────────────────── */
.desktop.auth-page {
    background-image: url("img/site_login_bg.jpg");
}

.desktop .logo.applogin-logo {
    background: none;
    box-shadow: none;
    width: 150px;
    height: 150px;
    margin-left: 0px;
    padding: 0px;
    margin-bottom: 0px;
}

.desktop .blue-container {
    justify-content: flex-start;
    background: #1e1e1e;
}

.desktop .applogin-welcome-heading {
    font-size: 22px;
    margin-bottom: 22px;
    font-weight: 400;
    color: #ff2d6f;
}

.desktop .welcome-text .applogin-welcome-heading {
    color: white;
}

.desktop .applogin-welcome-description,
.desktop .applogin-subtitle {
    opacity: 0.4;
}

.desktop .auth-container {
    background: #292929 !important;
}

.desktop .applogin-title,
.desktop .applogin-subtitle {
    color: white !important;
}

.desktop .signin-with-apple-button.applogin-apple-btn,
.desktop .applogin-google-wrapper,
.desktop .signin-with-google-button {
    background: white !important;
    color: black !important;
    border-radius: 8px !important;
}

.desktop .signin-with-apple-button::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='black' d='M15.569 10.663c.028 3.037 2.649 4.11 2.681 4.125-.022.068-.452 1.555-1.472 3.094-.877 1.332-1.786 2.661-3.285 2.688-1.477.027-1.937-.876-3.625-.876s-2.194.849-3.625.903c-1.453.054-2.485-.907-3.369-2.236C1.324 15.647.036 10.391 1.667 7.273c.874-1.7 2.432-2.785 4.12-2.812 1.43-.027 2.787.964 3.687.964s2.549-1.24 4.275-1.053c.717.03 2.714.268 4.088 2.19-.098.063-2.103 1.303-2.082 4.607zM12.647 2.844c.754-.923 1.474-2.219 1.306-3.511-1.262.052-2.778.846-3.582 1.767-.71.803-1.484 2.099-1.289 3.368 1.404.106 2.81-.726 3.564-1.624z'/%3E%3C/svg%3E") !important;
}

.mobileview-title {
    display: none;

}

/* ============================================================
   MOBILE LOGIN STYLES (≤768px)
   ============================================================ */
@media (max-width: 768px) {

    body.auth-page {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
    }

    .auth-page .container,
    .applogin-container {
        flex-direction: column !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-shadow: none !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    .auth-page .blue-container,
    .applogin-blue-container {
        width: 100vw !important;
        max-width: 100vw !important;
        min-height: 62vh !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-top: max(0px, env(safe-area-inset-top)) !important;
        padding-left: env(safe-area-inset-left, 0px) !important;
        padding-right: env(safe-area-inset-right, 0px) !important;
        padding-bottom: 80px !important;
        position: relative !important;
        border-radius: 0 !important;
        margin: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }

    .auth-page .blue-content,
    .applogin-blue-content {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .auth-page .logo-container,
    .applogin-logo-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-bottom: 40px !important;
        margin-top: 10px !important;
    }

    .auth-page .logo-container .logo,
    .applogin-logo {
        width: min(100px, 20vw);
        height: min(100px, 20vw);
        margin-top: clamp(20px, 9vh, 70px);
        margin-bottom: 17px;
        flex-shrink: 0;
        margin-left: 0px;
    }

    .desktop .auth-page .logo-container .logo,
    .desktop .applogin-logo {
        width: min(200px, 40vw) !important;
        height: min(200px, 40vw) !important;
        margin-top: clamp(20px, 9vh, 30px) !important;
        margin-bottom: 0px !important;
        flex-shrink: 0 !important;
        margin-left: 0px;
    }

    .auth-page .logo-container .app-name,
    .applogin-text-logo {
        margin-bottom: 5px !important;
        flex-shrink: 0 !important;
    }

    .auth-page .blue-tagline,
    .applogin-tagline {
        color: rgba(255, 255, 255, 0.95) !important;
        text-align: center !important;
        margin: 0 !important;
        letter-spacing: 0.3px !important;
    }

    .auth-page .welcome-text,
    .applogin-welcome-text {
        width: 100% !important;
        margin-top: clamp(25px, 6vh, 30px) !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .auth-page .welcome-text h2,
    .applogin-welcome-heading {
        color: white !important;
        text-align: center !important;
        line-height: 1.3 !important;
        margin: 30px 0 32px 0 !important;
        padding: 0 !important;
    }

    /* Keep desktop app heading exactly as desktop styles define it */
    .desktop .applogin-welcome-heading {
        color: #ff2d6f !important;
        font-size: 22px !important;
        font-weight: 400 !important;
        text-align: left !important;
        line-height: inherit !important;
        margin: 0 0 0px 0 !important;
        padding: 0 !important;
    }

    .desktop .welcome-text .applogin-welcome-heading {
        color: white !important;
    }




    .auth-page .welcome-text p,
    .applogin-welcome-description {
        text-align: center !important;
        line-height: 1.6 !important;
        margin: 0 !important;
        padding: 0 16px !important;
    }

    .auth-page .auth-container,
    .applogin-auth-container {
        background: white;
        border-radius: 32px 32px 0 0 !important;
        padding: 32px 24px !important;
        padding-bottom: max(50px, calc(50px + env(safe-area-inset-bottom))) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-top: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        z-index: 10 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
        left: 0 !important;
        right: 0 !important;
        flex-shrink: 0 !important;
    }

    .auth-page .auth-container h1,
    .applogin-title {
        color: #1a1a1a;
        text-align: center !important;
        margin: 0 0 8px 0 !important;
    }

    .auth-page .auth-container>p,
    .applogin-subtitle {
        color: #666;
        text-align: center !important;
        margin: 0 0 28px 0 !important;
    }

    .auth-page .signin-buttons-container,
    .applogin-buttons-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .auth-page .signin-with-apple-button,
    .applogin-apple-btn {
        width: 100% !important;
        max-width: 100% !important;
        height: 52px !important;
        background-color: #000 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }

    .auth-page #google-button-wrapper,
    .applogin-google-wrapper {
        width: 100% !important;
        height: 52px !important;
        position: relative !important;
    }

    .auth-page .signin-with-google-button,
    .applogin-google-btn {
        width: 100% !important;
        max-width: 100% !important;
        height: 52px !important;
        background-color: #000;
        color: #fff;
        border: none !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }

    .auth-page #google-signin-btn {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 52px !important;
        opacity: 0.01 !important;
        pointer-events: auto !important;
    }

    .auth-page #google-signin-btn iframe {
        width: 100% !important;
        height: 52px !important;
    }

    .mobileview-title {
        display: block;
    }

    .desktop-state-card {
        background: none;
    }
}


/* ── Very small screens (iPhone SE: ≤375px × ≤667px) ────────────────────── */
@media (max-width: 375px) and (max-height: 667px) {

    .auth-page .logo-container .logo,
    .applogin-logo {
        width: 80px !important;
        height: 80px !important;
        margin-top: 30px !important;
    }

    .desktop .auth-page .logo-container .logo,
    .desktop .applogin-logo {
        width: 160px !important;
        height: 160px !important;
        margin-top: 30px !important;
    }

    .auth-page .welcome-text,
    .applogin-welcome-text {
        margin-top: 30px !important;
    }

    .auth-page .blue-container,
    .applogin-blue-container {
        padding-bottom: 60px !important;
    }
}