:root {
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --slate-900: #1e293b;
    --slate-100: #f8fafc;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #64748b;
    --danger: #ef4444;
}
* { box-sizing: border-box; }
html { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #e0e7ff, #f8fafc 45%);
    color: var(--slate-900);
    display: flex;
    align-items: safe center;
    justify-content: center;
    min-height: 100%;
    padding: 24px;
}
main {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}
.card {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--gray-200);
    padding: 32px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
}
.login-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-card h1 {
    margin: 0;
    font-size: 1.9rem;
}
.login-card p {
    margin: 0;
    color: var(--gray-600);
    line-height: 1.5;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand img {
    width: 48px;
    height: 48px;
}
.status {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.status.info {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.3);
    color: var(--blue-dark);
}
.status.warning {
    background: rgba(250, 204, 21, 0.15);
    border-color: rgba(250, 204, 21, 0.4);
    color: #92400e;
}
.status.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--danger);
}
.google-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    align-items: stretch;
}

/*
  Google Identity Services renders a button with internal markup/iframes and
  injected styles. If those styles are blocked or overridden, the logo can
  balloon and cover the click target. These rules keep the container sane.
*/
#googleSignInButton {
    display: flex;
    justify-content: center;
}

#googleSignInButton > div,
#googleSignInButton iframe {
    max-width: 360px;
    width: 100% !important;
}

/* Keep any SVG/logo inside the Google button from expanding unexpectedly. */
#googleSignInButton svg {
    width: auto;
    height: auto;
}
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: var(--slate-900);
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    border-radius: 24px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.secondary-button:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.secondary-button:active {
    transform: translateY(0);
}
.secondary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.faq-card h2 {
    margin: 0 0 16px;
}
details {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--slate-100);
}
summary {
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
details[open] {
    background: white;
}
details p {
    margin: 8px 0 0;
    color: var(--gray-600);
    line-height: 1.5;
}
.version-note {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 8px;
}
.demo-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-400);
    font-size: 0.85rem;
    margin: 4px 0;
}
.demo-divider::before,
.demo-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}
.demo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.demo-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}
.demo-button:active {
    transform: translateY(0);
}
.demo-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.help-link {
    color: var(--blue-dark);
    font-weight: 600;
    text-decoration: none;
}

/* Mobile login view */
.mobile-login-view { display: none; }
.desktop-login-view { }

@media (max-width: 640px) {
    .mobile-login-view {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 48px 24px 24px;
        text-align: center;
        width: 100%;
    }
    .desktop-login-view { display: none !important; }
    main { display: flex; flex-direction: column; align-items: center; }
    body { padding: 0; align-items: flex-start; }

    .mobile-login-icon {
        width: 56px; height: 56px;
        background: var(--slate-900);
        color: white;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    .mobile-login-heading {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0 0 6px;
    }
    .mobile-login-sub {
        color: var(--gray-400);
        font-size: 0.95rem;
        margin: 0 0 28px;
    }
    .mobile-login-buttons {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .mobile-google-btn-wrap {
        display: flex;
        justify-content: center;
    }
    .mobile-google-btn-wrap > div,
    .mobile-google-btn-wrap iframe {
        max-width: 100%;
        width: 100% !important;
    }
    .mobile-auth-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 14px 20px;
        background: white;
        color: var(--slate-900);
        font-size: 0.95rem;
        font-weight: 600;
        border: 1px solid var(--gray-200);
        border-radius: 999px;
        cursor: pointer;
    }
    .mobile-auth-icon {
        width: 28px; height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    .microsoft-icon {
        background: #00a4ef;
        color: white;
    }
    .mobile-demo-btn {
        width: 100%;
        padding: 14px 20px;
        background: var(--slate-100);
        color: var(--slate-900);
        font-size: 0.95rem;
        font-weight: 600;
        border: 1px solid var(--gray-200);
        border-radius: 999px;
        cursor: pointer;
    }
    .mobile-faq-toggle {
        margin-top: 24px;
        border: none;
        background: none;
        padding: 0;
        width: 100%;
    }
    .mobile-faq-toggle > summary {
        color: var(--blue);
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        list-style: none;
        text-align: center;
    }
    .mobile-faq-toggle > summary::-webkit-details-marker { display: none; }
    .mobile-faq-content {
        margin-top: 16px;
        text-align: left;
    }
    .mobile-faq-content details {
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        padding: 10px 14px;
        margin-bottom: 10px;
        background: var(--slate-100);
    }
    .mobile-faq-content details p {
        margin: 6px 0 0;
        color: var(--gray-600);
        font-size: 0.88rem;
        line-height: 1.45;
    }
    .mobile-legal {
        margin-top: 24px;
        font-size: 0.8rem;
        color: var(--gray-400);
    }
    .mobile-legal a {
        color: var(--gray-400);
        text-decoration: underline;
    }
}
