/* ==========================================================
   PREMIUM MEDICAL GUIDE AI
   LOGIN PAGE
   COMPLETE STYLESHEET
   ========================================================== */

@import url("./variables.css");


/* ==========================================================
   RESET
   ========================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}


/* ==========================================================
   LOGIN PAGE
   ========================================================== */

.login-page {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
    padding: 40px;

    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.08),
            transparent 40%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(16, 185, 129, 0.06),
            transparent 35%
        ),
        #f5f7fa;
}


/* ==========================================================
   FLOATING BACKGROUND
   ========================================================== */

.login-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.45;

    animation:
        float 18s ease-in-out infinite;
}

.bg-circle-1 {
    width: 420px;
    height: 420px;

    background: #dbeafe;

    top: -140px;
    left: -120px;
}

.bg-circle-2 {
    width: 320px;
    height: 320px;

    background: #dcfce7;

    right: -90px;
    bottom: -80px;

    animation-delay: 4s;
}

.bg-circle-3 {
    width: 180px;
    height: 180px;

    background: #e0e7ff;

    top: 18%;
    right: 20%;

    animation-delay: 8s;
}


/* ==========================================================
   LOGIN CARD
   ========================================================== */

.login-card {
    position: relative;
    z-index: 2;

    width: 90vw;
    height: 85vh;

    max-width: 1400px;
    min-height: 650px;

    display: grid;

    /* FIXED: missing semicolon */
    grid-template-columns: 1fr 1fr;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 32px;

    overflow: hidden;

    box-shadow:
        0 30px 70px rgba(15, 23, 42, 0.08),
        0 8px 20px rgba(15, 23, 42, 0.05);

    animation: cardEnter 0.8s ease;

    backdrop-filter: blur(10px);
}


/* ==========================================================
   LEFT PANEL
   ========================================================== */

.login-brand {
    position: relative;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    width: 100%;

    padding: 70px;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #f8fafc
        );

    border-right: 1px solid var(--border);

    overflow: hidden;
}


/* Decorative vertical accent */

.login-brand::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 6px;
    height: 100%;

    background:
        linear-gradient(
            180deg,
            var(--primary),
            var(--secondary)
        );
}


/* Decorative circle */

.login-brand::after {
    content: "";

    position: absolute;

    width: 260px;
    height: 260px;

    border-radius: 50%;

    background: rgba(37, 99, 235, 0.04);

    right: -100px;
    top: -100px;

    pointer-events: none;
}


/* ==========================================================
   RIGHT PANEL
   ========================================================== */

.login-panel {
    position: relative;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: flex-start;

    width: 100%;

    padding: 70px;

    background: #ffffff;
}


/* Decorative accent */

.login-panel::after {
    content: "";

    position: absolute;

    right: 40px;
    bottom: 40px;

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: var(--secondary);

    opacity: 0.25;
}


/* ==========================================================
   PANEL SPACING
   ========================================================== */

.login-brand > * {
    margin-bottom: 22px;
}

.login-panel > * {
    width: 100%;
    margin-bottom: 22px;
}


/* ==========================================================
   LOGO CONTAINER
   ========================================================== */

.logo-container {
    display: flex;

    justify-content: center;
    align-items: center;

    width: 100%;
}


/* ==========================================================
   LOGO
   ========================================================== */

.login-logo {
    width: 220px;
    height: 220px;

    object-fit: contain;

    user-select: none;
    pointer-events: none;

    animation:
        logoFloat 8s ease-in-out infinite;
}


/* ==========================================================
   BRAND TITLES
   ========================================================== */

.login-brand h1 {
    font-size: 2.2rem;
    font-weight: 700;

    color: var(--text);

    text-align: center;

    line-height: 1.2;

    letter-spacing: -0.02em;
}

.tagline {
    max-width: 380px;

    font-size: 1rem;

    color: var(--text-light);

    text-align: center;

    line-height: 1.7;
}


/* ==========================================================
   DIVIDER
   ========================================================== */

.brand-divider {
    width: 100%;
    height: 1px;

    background: var(--border);

    margin: 30px 0;
}


/* ==========================================================
   FEATURE LIST
   ========================================================== */

.feature-list {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 14px;
}

.feature-item {
    display: flex;

    align-items: center;

    gap: 16px;

    padding: 14px 18px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 16px;

    transition:
        transform var(--fast),
        box-shadow var(--fast),
        border-color var(--fast);
}

.feature-item:hover {
    transform: translateX(6px);

    border-color: #bfdbfe;

    box-shadow:
        0 8px 18px rgba(37, 99, 235, 0.08);
}

.feature-icon {
    width: 34px;
    height: 34px;

    display: flex;

    justify-content: center;
    align-items: center;

    border-radius: 50%;

    background: #ecfdf5;

    color: var(--secondary);

    font-weight: 700;

    flex-shrink: 0;
}

.feature-item span:last-child {
    font-weight: 500;
    color: var(--text);
}


/* ==========================================================
   RIGHT PANEL TYPOGRAPHY
   ========================================================== */

.login-panel h2 {
    font-size: 2rem;

    font-weight: 700;

    color: var(--text);

    line-height: 1.2;
}

.welcome-text {
    max-width: 420px;

    color: var(--text-light);

    font-size: 1rem;

    line-height: 1.8;
}


/* ==========================================================
   WELCOME BADGE
   ========================================================== */

.welcome-badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: auto;

    align-self: flex-start;

    padding: 8px 18px;

    border-radius: 999px;

    background: #eff6ff;

    color: var(--primary);

    font-weight: 600;

    font-size: 0.85rem;

    border: 1px solid #bfdbfe;
}


/* ==========================================================
   GOOGLE BUTTON
   ========================================================== */

.google-btn {
    position: relative;

    width: 100%;
    height: 58px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 16px;

    cursor: pointer;

    border: none;
    outline: none;

    border-radius: 16px;

    background: var(--primary);

    color: #ffffff;

    font-size: 1rem;
    font-weight: 600;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;

    box-shadow:
        0 12px 28px rgba(37, 99, 235, 0.25);

    overflow: hidden;
}

.google-btn:hover {
    background: var(--primary-dark);

    transform: translateY(-2px);

    box-shadow:
        0 18px 36px rgba(37, 99, 235, 0.3);
}

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

.google-btn:disabled {
    opacity: 0.75;

    cursor: not-allowed;

    transform: none;
}


/* ==========================================================
   GOOGLE ICON
   ========================================================== */

.google-btn img,
.google-icon-img {
    width: 22px;
    height: 22px;

    flex-shrink: 0;

    background: #ffffff;

    border-radius: 50%;

    padding: 2px;

    transition: opacity 0.25s ease;
}


/* ==========================================================
   GOOGLE SPINNER
   ========================================================== */

.google-spinner {
    position: absolute;

    right: 22px;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    border: 2px solid rgba(255, 255, 255, 0.35);

    border-top-color: #ffffff;

    animation:
        spin 0.7s linear infinite;

    display: none;
}

.google-btn.loading .google-spinner {
    display: block;
}

.google-btn.loading .google-icon-img {
    opacity: 0.4;
}

.google-btn.loading {
    cursor: wait;
}

.google-btn.success {
    background: #10b981;
}

.google-btn.error {
    background: #dc2626;
}


/* ==========================================================
   LOGIN STATUS
   ========================================================== */

.login-status {
    min-height: 24px;

    font-size: 0.95rem;

    font-weight: 500;

    color: var(--text-light);

    transition:
        all 0.3s ease;
}

.login-status.success {
    color: var(--success);
}

.login-status.error {
    color: var(--danger);
}

.login-status.loading {
    color: var(--primary);
}


/* ==========================================================
   SECURITY SECTION
   ========================================================== */

.login-security {
    display: flex;

    flex-direction: column;

    gap: 14px;

    padding: 24px;

    background: #f8fafc;

    border: 1px solid var(--border);

    border-radius: 18px;
}

.login-security div {
    display: flex;

    align-items: center;

    gap: 12px;

    color: var(--text);

    font-size: 0.95rem;
}


/* ==========================================================
   USER CARD
   ========================================================== */

.login-user-card {
    display: none;

    align-items: center;

    gap: 16px;

    margin-top: 10px;

    padding: 18px;

    border-radius: 16px;

    border: 1px solid var(--border);

    background: #f8fafc;

    animation:
        fadeIn 0.35s ease;
}

.login-user-card.show {
    display: flex;
}

.user-avatar {
    width: 60px;
    height: 60px;

    border-radius: 50%;

    object-fit: cover;

    border: 2px solid #e5e7eb;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1rem;

    font-weight: 600;

    color: var(--text);
}

.user-email {
    margin-top: 4px;

    color: var(--text-light);

    font-size: 0.9rem;
}

.workspace-status {
    margin-top: 8px;

    color: var(--primary);

    font-size: 0.85rem;
}


/* ==========================================================
   FOOTER
   ========================================================== */

.login-footer {
    margin-top: auto;

    padding-top: 20px;

    border-top: 1px solid var(--border);

    display: flex;

    justify-content: space-between;

    align-items: center;

    font-size: 0.9rem;

    color: var(--text-light);
}

.login-footer strong {
    color: var(--text);

    font-weight: 600;
}

.login-footer span {
    color: var(--text-light);
}


/* ==========================================================
   FOCUS STATES
   ========================================================== */

button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);

    outline-offset: 3px;
}


/* ==========================================================
   LOADING OVERLAY
   ========================================================== */

.loading-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    justify-content: center;
    align-items: center;

    background: rgba(255, 255, 255, 0.82);

    backdrop-filter: blur(10px);

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;

    z-index: 999;
}

.loading-overlay.show {
    opacity: 1;

    visibility: visible;
}

.loading-card {
    width: 360px;

    padding: 40px;

    background: #ffffff;

    border-radius: 24px;

    border: 1px solid var(--border);

    text-align: center;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.1);
}

.loading-card h3 {
    margin-top: 24px;

    margin-bottom: 10px;

    font-size: 1.35rem;

    color: var(--text);
}

.loading-card p {
    color: var(--text-light);

    line-height: 1.7;
}

.loading-spinner {
    width: 64px;
    height: 64px;

    margin: auto;

    border-radius: 50%;

    border: 5px solid #e5e7eb;

    border-top-color: var(--primary);

    animation:
        spin 0.8s linear infinite;
}


/* ==========================================================
   GENERAL SPINNER
   ========================================================== */

.spinner {
    width: 18px;
    height: 18px;

    border: 2px solid rgba(255, 255, 255, 0.35);

    border-top-color: #ffffff;

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;
}


/* ==========================================================
   ANIMATIONS
   ========================================================== */

@keyframes float {
    0% {
        transform:
            translateY(0)
            translateX(0);
    }

    50% {
        transform:
            translateY(-30px)
            translateX(20px);
    }

    100% {
        transform:
            translateY(0)
            translateX(0);
    }
}


@keyframes cardEnter {
    from {
        opacity: 0;

        transform:
            translateY(30px)
            scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


@keyframes logoFloat {
    0% {
        transform:
            translateY(0);
    }

    50% {
        transform:
            translateY(-8px);
    }

    100% {
        transform:
            translateY(0);
    }
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


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


/* ==========================================================
   LARGE LAPTOPS
   ========================================================== */

@media (max-width: 1400px) {

    .login-card {
        width: min(1100px, 94vw);
    }

}


/* ==========================================================
   TABLETS
   ========================================================== */

@media (max-width: 1100px) {

    .login-card {
        grid-template-columns: 1fr;

        width: min(760px, 94vw);

        min-height: auto;
    }

    .login-brand {
        border-right: none;

        border-bottom: 1px solid var(--border);
    }

    .login-brand::before {
        width: 100%;

        height: 6px;
    }

}


/* ==========================================================
   SMALL TABLETS
   ========================================================== */

@media (max-width: 900px) {

    .login-brand,
    .login-panel {
        padding: 50px;
    }

    .login-logo {
        width: 180px;
        height: 180px;
    }

    .login-brand h1 {
        font-size: 1.9rem;
    }

    .login-panel h2 {
        font-size: 1.7rem;
    }

}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 700px) {

    html,
    body {
        overflow: auto;
    }

    .login-page {
        padding: 30px 16px;

        height: auto;

        min-height: 100vh;
    }

    .login-card {
        width: 100%;

        height: auto;

        border-radius: 24px;
    }

    .login-brand,
    .login-panel {
        padding: 36px 26px;
    }

    .login-logo {
        width: 140px;
        height: 140px;
    }

    .login-brand h1 {
        font-size: 1.55rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .feature-item {
        padding: 12px 14px;
    }

    .google-btn {
        height: 54px;

        font-size: 0.95rem;
    }

    .login-footer {
        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }

}


/* ==========================================================
   VERY SMALL SCREENS
   ========================================================== */

@media (max-width: 420px) {

    .login-brand,
    .login-panel {
        padding: 28px 20px;
    }

    .login-logo {
        width: 120px;
        height: 120px;
    }

    .login-brand h1 {
        font-size: 1.35rem;
    }

    .login-panel h2 {
        font-size: 1.45rem;
    }

    .welcome-text {
        font-size: 0.92rem;
    }

}


/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;

        transition: none !important;

        scroll-behavior: auto !important;
    }

}


/* ==========================================================
   TEXT SELECTION
   ========================================================== */

::selection {
    background: #bfdbfe;

    color: #111827;
}


/* ==========================================================
   SCROLLBAR
   ========================================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ==========================================================
   SMOOTH FADE
   ========================================================== */

.fade-in {
    animation:
        fadeIn 0.4s ease;
}


/* ==========================================================
   LOGIN MODE
========================================================== */

body.login-mode {
    overflow: hidden;
}

body.login-mode #app-shell {
    display: block;
    width: 100%;
    height: 100vh;
}

body.login-mode #sidebar {
    display: none;
}

body.login-mode #main-view {
    display: block;
    width: 100%;
    height: 100vh;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}


/* ==========================================================
   FINAL SAFETY
   ========================================================== */

.login-page,
.login-card,
.login-brand,
.login-panel {
    isolation: isolate;
}

/* ==========================================================
   ELECTRON LOGIN WINDOW FIX
   ========================================================== */

body.login-mode {
    overflow: auto !important;
}

body.login-mode #main-view {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100vh !important;
}

body.login-mode .login-page {
    width: 100% !important;
    min-height: 100% !important;
    height: auto !important;

    padding: 24px !important;

    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;

    overflow: visible !important;
}

body.login-mode .login-card {
    width: 100% !important;
    max-width: 1100px !important;

    height: auto !important;
    min-height: 0 !important;

    display: grid !important;
    grid-template-columns: 1fr 1fr !important;

    border-radius: 24px !important;
}

body.login-mode .login-brand,
body.login-mode .login-panel {
    padding: 36px !important;
}

body.login-mode .login-logo {
    width: 120px !important;
    height: 120px !important;
}

body.login-mode .login-brand > * {
    margin-bottom: 12px !important;
}

body.login-mode .feature-list {
    gap: 8px !important;
}

body.login-mode .feature-item {
    padding: 8px 12px !important;
}

body.login-mode .login-panel > * {
    margin-bottom: 14px !important;
}

body.login-mode .google-btn {
    width: 100% !important;
    height: 54px !important;
    min-height: 54px !important;

    display: flex !important;

    font-size: 1rem !important;
}


/* ==========================================================
   END
   ========================================================== */