/* ============================================
   REGISTER PAGE CSS
   Compatible with Public Header
   Colors: #87BCD4, #6ba3c0, #ffffff, #e9ecef
   Font Size: 14px base
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #87BCD4;
    --primary-dark: #6ba3c0;
    --primary-light: #b8d9ec;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --dark-bg: #1a1a2e;
    --dark-surface: #16213e;
    --dark-border: #0f3460;
    --dark-text: #e5e5e5;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --google-blue: #4285f4;
}

/* Register Container */
.register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 70px);
    padding: 100px 20px 40px;
}

.register-card {
    background: var(--white);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 950px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
.register-card h2 {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Alert Messages */
.alert {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--error);
    border-left: 4px solid var(--error);
}

.alert-error a {
    color: var(--error);
    text-decoration: underline;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border-left: 4px solid var(--success);
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.2rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group label i {
    color: var(--primary-color);
    margin-right: 0.5rem;
    width: 18px;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(135, 188, 212, 0.2);
}

.form-group input.error {
    border-color: var(--error);
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--gray-600);
}

/* Password Group */
.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    bottom: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray-600);
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Password Strength */
.password-strength {
    margin-top: 0.4rem;
    font-size: 0.7rem;
}

/* Gender Group */
.gender-group {
    margin-bottom: 1.2rem;
}

.gender-group > label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
    font-weight: 500;
    font-size: 0.85rem;
}

.gender-group > label i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.radio-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-label {
    font-size: 0.85rem;
    color: var(--gray-700);
}

/* Phone Preview */
.phone-preview {
    margin-top: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: #f0fdf4;
    border-radius: 10px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.phone-preview i {
    color: var(--success);
}

.phone-preview span {
    color: #166534;
    font-weight: bold;
    font-family: monospace;
}

.hidden {
    display: none;
}

/* Register Button */
.btn-save {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(135, 188, 212, 0.3);
}

.btn-save:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--gray-600);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider::before {
    margin-right: 1rem;
}

.divider::after {
    margin-left: 1rem;
}

/* Google Button */
.btn-google {
    width: 100%;
    padding: 0.8rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--gray-700);
}

.btn-google:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-google:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-google i {
    font-size: 1.1rem;
    color: var(--google-blue);
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.login-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.form-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-loader-overlay span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Dark Mode Support */
body.dark-mode .register-card {
    background: var(--dark-surface);
}

body.dark-mode .register-card h2 {
    color: var(--primary-light);
}

body.dark-mode .subtitle {
    color: #9ca3af;
}

body.dark-mode .form-group label,
body.dark-mode .gender-group > label {
    color: var(--dark-text);
}

body.dark-mode .form-group input {
    background: #1f2937;
    border-color: #374151;
    color: var(--dark-text);
}

body.dark-mode .form-group input:focus {
    border-color: var(--primary-color);
}

body.dark-mode .radio-label {
    color: var(--dark-text);
}

body.dark-mode .btn-google {
    background: #1f2937;
    border-color: #374151;
    color: var(--dark-text);
}

body.dark-mode .btn-google:hover {
    background: #374151;
}

body.dark-mode .divider::before,
body.dark-mode .divider::after {
    border-bottom-color: #374151;
}

body.dark-mode .login-link {
    color: #9ca3af;
}

body.dark-mode .alert-error {
    background: #450a0a;
    color: #fca5a5;
}

body.dark-mode .phone-preview {
    background: #064e3b;
}

body.dark-mode .phone-preview span {
    color: #86efac;
}

/* Responsive Design */
@media (max-width: 768px) {
    .register-container {
        padding: 80px 15px 30px;
    }
    
    .register-card {
        padding: 1.5rem;
    }
    
    .register-card h2 {
        font-size: 1.5rem;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .radio-container {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .register-container {
        padding: 70px 12px 20px;
    }
    
    .register-card {
        padding: 1.2rem;
        border-radius: 20px;
    }
    
    .register-card h2 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input {
        padding: 0.65rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .btn-save,
    .btn-google {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    .radio-container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .two-column-layout {
        gap: 0;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-save,
    .btn-google {
        padding: 0.9rem;
    }
    
    .form-group input {
        font-size: 16px;
    }
    
    .toggle-password {
        bottom: 0.85rem;
    }
}