/* Modern Authentication Pages Styling */

:root {
    --primary-color: #5b2c91;
    --primary-dark: #4a1f77;
    --primary-light: #6b3ca1;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --text-dark: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modern Login/Registration Container */
.modern-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    /* Background uses original layout background */
}

.modern-auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
    overflow: hidden;
    margin: 20px auto;
}

.modern-auth-card.large {
    max-width: 800px;
}

.modern-auth-header {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.modern-auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: white;
}

.modern-auth-header p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

.modern-auth-logo {
    width: 60px;
    height: auto;
    margin-bottom: 20px;
}

.modern-auth-body {
    padding: 40px 35px;
}

/* Progress Indicator */
.registration-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    padding: 0 20px;
}

.registration-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.progress-step.active .progress-step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(91, 44, 145, 0.2);
}

.progress-step.completed .progress-step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.progress-step.completed .progress-step-circle::before {
    content: '✓';
    font-size: 18px;
}

.progress-step-label {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    max-width: 80px;
}

.progress-step.active .progress-step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed .progress-step-label {
    color: var(--success-color);
}

/* Modern Form Styling */
.modern-form-group {
    margin-bottom: 25px;
}

.modern-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.modern-form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.modern-form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(91, 44, 145, 0.1);
}

.modern-form-control::placeholder {
    color: var(--text-light);
}

.modern-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-btn-primary {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
}

.modern-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.modern-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.modern-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading Spinner */
.modern-btn.loading {
    color: transparent;
    pointer-events: none;
}

.modern-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert Messages */
.modern-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid;
    font-size: 14px;
}

.modern-alert-success {
    background: #f0f9ff;
    border-color: var(--success-color);
    color: #065f46;
}

.modern-alert-danger {
    background: #fef2f2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.modern-alert-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Verification Code Input */
.verification-code-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.verification-code-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
    transition: all 0.3s ease;
}

.verification-code-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(91, 44, 145, 0.1);
    transform: scale(1.1);
}

/* Section Cards */
.section-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.section-card-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

/* Footer Links */
.modern-auth-footer {
    padding: 25px 35px;
    background: var(--bg-light);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.modern-auth-footer p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-light);
}

.modern-auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.modern-auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* File Upload */
.modern-file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.modern-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.modern-file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.modern-file-upload-label:hover {
    border-color: var(--primary-color);
    background: rgba(91, 44, 145, 0.05);
}

.modern-file-upload-label.has-file {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .modern-auth-card {
        border-radius: 15px;
    }

    .modern-auth-body {
        padding: 30px 20px;
    }

    .registration-progress {
        padding: 0 10px;
    }

    .progress-step-label {
        font-size: 11px;
        max-width: 60px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-auth-card {
    animation: fadeIn 0.5s ease-out;
}

/* Form Loader - Ensure it's hidden by default */
.form-loader-overlay {
    display: none !important;
    position: fixed;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.95);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.form-loader-overlay.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.form-loader-content {
    text-align: center;
}

/* Style native select elements on mobile */
select.form-control,
select.modern-form-control {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
    cursor: pointer;
}

/* Fix iOS specific touch action focus outline */
select.form-control:focus,
select.modern-form-control:focus {
    outline: none;
    border-color: #5b2c91;
    box-shadow: 0 0 0 3px rgba(91, 44, 145, 0.1);
}