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

:root {
    --blue-500: #2563EB;
    --cyan-500: #06B6D4;
    --purple-500: #7C3AED;
    --green-500: #10B981;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-700);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--blue-500);
}

.login-page {
    display: flex;
    min-height: 100vh;
}

/* ===== LEFT BRAND PANEL ===== */
.login-brand {
    flex: 1;
    background: linear-gradient(135deg, #1e3a8a, #0e7490);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.brand-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: white;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 250px;
    height: 250px;
    bottom: -50px;
    left: -50px;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 60%;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-decoration: none;
}

.brand-headline {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.brand-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 3rem;
}

.brand-stats {
    display: flex;
    gap: 2.5rem;
}

.brand-stat {
    display: flex;
    flex-direction: column;
}

.brand-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.brand-stat-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}

/* ===== RIGHT FORM PANEL ===== */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--white);
}

.form-container {
    width: 100%;
    max-width: 420px;
}

.form-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.form-tab {
    flex: 1;
    padding: 0.65rem 1rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-500);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
}

.form-tab.active {
    background: var(--white);
    color: var(--gray-800);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.auth-form.hidden {
    display: none;
}

.form-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--gray-400);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.forgot-link {
    font-size: 0.78rem;
    color: var(--blue-500);
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    color: var(--gray-400);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--gray-800);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input::placeholder {
    color: var(--gray-300);
}

.toggle-pw {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 2px;
    display: flex;
}

.toggle-pw:hover {
    color: var(--gray-600);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.divider span {
    font-size: 0.78rem;
    color: var(--gray-400);
    white-space: nowrap;
}

/* Social Buttons */
.social-btns {
    display: flex;
    gap: 0.75rem;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* Role Selector */
.role-selector {
    display: flex;
    gap: 0.75rem;
}

.role-option {
    flex: 1;
    cursor: pointer;
}

.role-option input {
    display: none;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.35rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    color: var(--gray-400);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: var(--white);
}

.role-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
    border-radius: calc(var(--radius-lg) - 2px);
}

#role-business .role-card::before {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(6, 182, 212, 0.04));
}

#role-investor .role-card::before {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(236, 72, 153, 0.04));
}

.role-card:hover {
    border-color: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.role-card:hover::before {
    opacity: 1;
}

.role-card svg {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.role-card:hover svg {
    transform: scale(1.15);
}

.role-card span {
    font-size: 0.85rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

/* Business role selected */
#role-business input:checked + .role-card {
    border-color: var(--blue-500);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(6, 182, 212, 0.06));
    color: var(--blue-500);
    box-shadow: 
        0 4px 15px rgba(37, 99, 235, 0.15),
        0 0 0 3px rgba(37, 99, 235, 0.06);
    transform: translateY(-2px);
}

#role-business input:checked + .role-card::before {
    opacity: 1;
}

#role-business input:checked + .role-card svg {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.25));
}

/* Investor role selected */
#role-investor input:checked + .role-card {
    border-color: var(--purple-500);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.06));
    color: var(--purple-500);
    box-shadow: 
        0 4px 15px rgba(124, 58, 237, 0.15),
        0 0 0 3px rgba(124, 58, 237, 0.06);
    transform: translateY(-2px);
}

#role-investor input:checked + .role-card::before {
    opacity: 1;
}

#role-investor input:checked + .role-card svg {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(124, 58, 237, 0.25));
}

/* Active animation */
.role-option input:checked + .role-card {
    animation: roleSelect 0.4s ease;
}

@keyframes roleSelect {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-4px) scale(1.02); }
    100% { transform: translateY(-2px) scale(1); }
}

.form-terms {
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: var(--gray-400);
    text-align: center;
    line-height: 1.5;
}

.form-terms a {
    text-decoration: underline;
}

/* ===== LOADING STATE ===== */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== GOOGLE SIGN-IN MODAL ===== */
.google-signin-btn {
    flex: 2;
}

.google-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.google-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.google-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.google-modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    flex: 1;
}

.google-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.google-modal-close:hover {
    color: var(--gray-700);
}

.google-modal-body {
    padding: 1.25rem 1.5rem;
}

.google-modal-info {
    font-size: 0.88rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.google-modal-note {
    font-size: 0.78rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 1rem;
}

.google-account-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.google-account-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

.google-account-item:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.google-account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.google-account-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.google-account-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-800);
}

.google-account-email {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.google-modal-footer-text {
    font-size: 0.72rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.google-modal-footer-text a {
    color: var(--blue-500);
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .login-brand {
        display: none;
    }

    .login-form-panel {
        padding: 2rem;
    }
}

    @media (max-width: 480px) {
    .form-container {
        max-width: 100%;
    }

    .form-title {
        font-size: 1.35rem;
    }

    .social-btns {
        flex-direction: column;
    }
}

/* ===== AUTH MESSAGE BANNER ===== */
.auth-message-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(244, 63, 94, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #DC2626;
    margin-bottom: 1.25rem;
    animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
}

.auth-message-banner.hidden {
    display: none !important;
}

.message-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
    flex-shrink: 0;
    color: #EF4444;
}

.message-banner-text {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
    text-align: left;
}

.message-banner-close {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    line-height: 1;
    color: rgba(220, 38, 38, 0.5);
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    width: 18px;
}

.message-banner-close:hover {
    color: #DC2626;
}

@keyframes bannerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
