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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Auth pages inherit from main body styles */
#app .auth-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d1117;
    min-height: 100vh;
    color: #f0f6fc;
    margin: 0;
    padding: 0;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #21262d 100%);
    position: relative;
    width: 100%;
}

/* Ensure auth container works in SPA */
#app .auth-container {
    min-height: 100vh;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(88,166,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

/* Header */
.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    position: relative;
    z-index: 10;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #8b949e;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.back-link:hover {
    color: #f0f6fc;
    background: rgba(48, 54, 61, 0.3);
    border-color: rgba(48, 54, 61, 0.5);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #f0f6fc;
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-icon {
    font-size: 2rem;
}

/* Main Content */
.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

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

.auth-form-container.active {
    display: block;
}

.auth-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.auth-form-section {
    min-width: 0;
}

.auth-benefits {
    min-width: 0;
}

.auth-benefits h3 {
    color: #f0f6fc;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.benefits-grid {
    display: grid;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-hint {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #f0f6fc;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(48, 54, 61, 0.8);
    border-radius: 4px;
    background: rgba(13, 17, 23, 0.6);
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: all 0.2s;
}

.checkbox-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #58a6ff, #1f6feb);
    border-color: #58a6ff;
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-item:hover input[type="checkbox"] {
    border-color: #58a6ff;
}

.link {
    color: #58a6ff;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.link:hover {
    color: #79c0ff;
    text-decoration: underline;
}

.auth-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #58a6ff, transparent);
    opacity: 0.3;
}

.auth-divider span {
    background: rgba(22, 27, 34, 0.9);
    padding: 0 1.5rem;
    color: #8b949e;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 12px;
    background: rgba(13, 17, 23, 0.6);
    color: #f0f6fc;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.btn-social:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-social.google {
    border-color: rgba(66, 133, 244, 0.3);
    background: rgba(66, 133, 244, 0.05);
}

.btn-social.google:hover {
    border-color: rgba(66, 133, 244, 0.5);
    background: rgba(66, 133, 244, 0.1);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.btn-social.github {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.btn-social.github:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: #ef4444;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-text {
    color: #6b7280;
    font-size: 0.75rem;
}

.auth-card {
    background: rgba(22, 27, 34, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(48, 54, 61, 0.5);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 900px;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #58a6ff, #a5d6ff);
    border-radius: 20px 20px 0 0;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #f0f6fc;
    margin-bottom: 0.5rem;
}

.auth-card-header p {
    color: #8b949e;
    font-size: 1.1rem;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #f0f6fc;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.form-group input,
.form-group select {
    padding: 1rem 1.25rem;
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: rgba(13, 17, 23, 0.6);
    color: #f0f6fc;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
    background: rgba(13, 17, 23, 0.8);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #6e7681;
    font-weight: 400;
}

.password-requirements {
    margin-top: 0.25rem;
}

.password-requirements small {
    color: #6b7280;
    font-size: 0.75rem;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.terms-checkbox {
    margin-top: 0.5rem;
}

.terms-checkbox span {
    font-size: 0.875rem;
    color: #6b7280;
}

.link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

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

/* Submit Button */
.btn-submit {
    background: linear-gradient(135deg, #58a6ff, #1f6feb);
    color: white;
    padding: 1.25rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
    width: 100%;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.025em;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #1f6feb, #0969da);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 166, 255, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.btn-submit:disabled {
    background: #6e7681;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(48, 54, 61, 0.3);
}

.auth-footer p {
    color: #8b949e;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-footer .link {
    color: #58a6ff;
    font-weight: 600;
    transition: all 0.2s;
}

.auth-footer .link:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* Benefits Sidebar */
.benefits-sidebar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    height: fit-content;
}

.benefits-sidebar h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.benefit-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: start;
}

.benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.benefit-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.benefit-item p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Form Validation */
.form-group.error input,
.form-group.error select {
    border-color: #ef4444;
}

.form-group.success input,
.form-group.success select {
    border-color: #10b981;
}

.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.success-message {
    color: #10b981;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Loading State */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }
    
    .auth-card {
        justify-self: center;
        max-width: none;
        padding: 2rem;
    }
    
    .benefits-sidebar {
        order: -1;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .auth-header {
        padding: 1rem;
    }
}
