/* ================================================================
   🚀 BOXTOOLS - UNIFIED AUTHENTICATION & GOOGLE MATERIAL DESIGN 3
   Design System for Login, Signup, Password Recovery & OAuth
   ================================================================ */

:root {
    --g-bg-page: #F8FAFC;
    --g-surface: #FFFFFF;
    --g-surface-subtle: #FAFAFC;
    --g-border: #E2E8F0;
    --g-border-focus: #1A73E8;
    
    /* Google Brand Palette */
    --g-blue: #1A73E8;
    --g-blue-hover: #1557B0;
    --g-blue-bg: #E8F0FE;
    
    --g-green: #34A853;
    --g-green-bg: #E6F4EA;
    
    --g-yellow: #FBBC04;
    --g-yellow-bg: #FEF7E0;

    --g-red: #EA4335;
    --g-red-bg: #FCE8E6;
    
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --text-subtle: #80868B;
    
    --radius-container: 28px;
    --radius-input: 12px;
    --radius-pill: 100px;
    
    --g-elevation: 0 1px 3px rgba(60,64,67,0.08), 0 8px 24px -4px rgba(60,64,67,0.12);
}

/* Dark Mode Tokens */
[data-bs-theme="dark"],
[data-theme="dark"],
.dark-theme {
    --g-bg-page: #0B1120;
    --g-surface: #1E293B;
    --g-surface-subtle: #182234;
    --g-border: #334155;
    --g-border-focus: #3B82F6;
    
    --g-blue: #3B82F6;
    --g-blue-hover: #2563EB;
    --g-blue-bg: rgba(59, 130, 246, 0.15);
    
    --g-green: #22C55E;
    --g-green-bg: rgba(34, 197, 94, 0.15);
    
    --g-yellow: #F59E0B;
    --g-yellow-bg: rgba(245, 158, 11, 0.15);

    --g-red: #EF4444;
    --g-red-bg: rgba(239, 68, 68, 0.15);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-subtle: #64748B;
    
    --g-elevation: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 1. MASTER CENTERED STAGE */
.g-stage-wrapper {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}

/* 2. UNIFIED MATERIAL CARD */
.g-unified-card {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--radius-container);
    box-shadow: var(--g-elevation);
    max-width: 1040px;
    width: 100%;
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 900px) {
    .g-unified-card {
        grid-template-columns: 1fr;
        max-width: 540px;
    }
}

/* 3. LEFT COLUMN: IDENTITY & CONTEXT PANEL */
.g-context-panel {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--g-surface-subtle);
    border-right: 1px solid var(--g-border);
}

@media (max-width: 900px) {
    .g-context-panel {
        padding: 2.5rem 2rem 1.5rem 2rem;
        border-right: none;
        border-bottom: 1px solid var(--g-border);
    }
}

[dir="rtl"] .g-context-panel {
    border-right: none;
    border-left: 1px solid var(--g-border);
}

@media (max-width: 900px) {
    [dir="rtl"] .g-context-panel {
        border-left: none;
        border-bottom: 1px solid var(--g-border);
    }
}

.g-brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.g-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--g-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

.g-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.g-logo-text span {
    color: var(--g-blue);
}

.g-context-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.g-context-desc {
    font-size: 0.975rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Feature Chips */
.g-chips-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.g-chip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.g-chip-dot {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.g-chip-dot.blue { background: var(--g-blue-bg); color: var(--g-blue); }
.g-chip-dot.green { background: var(--g-green-bg); color: var(--g-green); }
.g-chip-dot.yellow { background: var(--g-yellow-bg); color: var(--g-yellow); }
.g-chip-dot.red { background: var(--g-red-bg); color: var(--g-red); }

/* 4. RIGHT COLUMN: FORM & ENGINE PANEL */
.g-form-panel {
    padding: 3.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--g-surface);
}

@media (max-width: 900px) {
    .g-form-panel {
        padding: 2.5rem 2rem;
    }
}

.g-form-header {
    margin-bottom: 2rem;
}

.g-form-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

/* Google OAuth Continue Button */
.g-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    background: var(--g-surface);
    color: var(--text-primary);
    border: 1px solid var(--g-border);
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.g-btn-google:hover {
    background: var(--g-surface-subtle);
    border-color: #CBD5E1;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.g-btn-google svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Auth Divider */
.g-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-subtle);
    font-size: 0.825rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.g-auth-divider::before,
.g-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--g-border);
}

.g-auth-divider span {
    padding: 0 1rem;
}

/* Material Form Inputs */
.g-field-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.g-field-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.g-field-group input[type="text"],
.g-field-group input[type="email"],
.g-field-group input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--g-surface);
    border: 1.5px solid var(--g-border);
    border-radius: var(--radius-input);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.g-field-group input:focus {
    border-color: var(--g-border-focus);
    box-shadow: 0 0 0 3px var(--g-blue-bg);
}

.g-field-help {
    font-size: 0.8rem;
    color: var(--text-subtle);
    margin-top: 0.4rem;
}

.g-error-list {
    list-style: none;
    padding: 0;
    margin: 0.4rem 0 0 0;
    font-size: 0.8rem;
    color: var(--g-red);
    font-weight: 500;
}

/* Action Controls & Buttons */
.g-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 16px;
}

@media (max-width: 500px) {
    .g-action-row {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

.g-btn-primary,
.g-btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 28px;
    background: var(--g-blue);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.g-btn-primary:hover,
.g-btn-solid:hover {
    background: var(--g-blue-hover);
    color: white;
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.4);
}

.g-btn-primary:active,
.g-btn-solid:active {
    transform: scale(0.98);
}

.g-btn-ghost,
.g-btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    color: var(--g-blue);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: background 0.2s;
    background: transparent;
    border: none;
}

.g-btn-ghost:hover,
.g-btn-text:hover {
    background: var(--g-blue-bg);
    color: var(--g-blue-hover);
}

.g-field-help,
.g-help-text {
    font-size: 0.8rem;
    color: var(--text-subtle);
    margin-top: 0.4rem;
    display: block;
}

/* Status Cards & Info Callouts */
.g-status-box,
.g-status-callout {
    background: var(--g-blue-bg);
    border: 1px solid rgba(26, 115, 232, 0.2);
    border-radius: var(--radius-input);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.g-status-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--g-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.g-status-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.g-status-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.g-info-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.875rem 1rem;
    background: var(--g-surface-subtle);
    border: 1px solid var(--g-border);
    border-radius: var(--radius-input);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.g-info-notice i {
    color: var(--g-blue);
    font-size: 1rem;
    flex-shrink: 0;
}

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

.g-input-wrap input {
    width: 100%;
    padding-right: 44px !important;
}

[dir="rtl"] .g-input-wrap input {
    padding-right: 16px !important;
    padding-left: 44px !important;
}

.pwd-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-subtle);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

[dir="rtl"] .pwd-toggle-btn {
    right: auto;
    left: 12px;
}

.pwd-toggle-btn:hover {
    color: var(--text-primary);
}

.g-invalid-box {
    background: var(--g-red-bg);
    border: 1px solid rgba(234, 67, 53, 0.2);
    border-radius: var(--radius-input);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.g-invalid-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--g-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.g-invalid-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.g-invalid-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.g-btn-solid.red {
    background: var(--g-red);
}

.g-btn-solid.red:hover {
    background: #D93025;
}

.g-success-badge-wrap {
    text-align: center;
    margin-bottom: 1.5rem;
}

.g-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--g-green-bg);
    color: var(--g-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}
