/* Authentication Pages Styles */

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 15px;
}

.offset-md-3 {
    margin-left: 25%;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

/* Margins and Padding */
.mt-5 { margin-top: 3rem; }
.mb-5 { margin-bottom: 3rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Display Utilities */
.d-none { display: none; }
.d-block { display: block; }

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

select.form-control {
    cursor: pointer;
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

/* Button Styles */
.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #005cbf;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    color: #fff;
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Registration Wizard Styles - Updated from SCSS */
.registration-wizard {
    max-width: 600px;
    margin: 80px auto 0;
    padding: 2rem;
}

.registration-wizard .wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.registration-wizard .wizard-header h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.registration-wizard .wizard-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    gap: 20px;
}

.registration-wizard .wizard-progress .step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #666;
    position: relative;
    transition: all 0.3s ease;
}

.registration-wizard .wizard-progress .step.active {
    background: #007bff;
    color: white;
    transform: scale(1.1);
}

.registration-wizard .wizard-progress .step.completed {
    background: #28a745;
    color: white;
}

.registration-wizard .wizard-progress .step.completed .num {
    display: none;
}

.registration-wizard .wizard-progress .step.completed::before {
    content: '✓';
    font-size: 18px;
    position: absolute;
}

.registration-wizard .wizard-progress .step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    width: 20px;
    height: 2px;
    background: #e0e0e0;
    transform: translateY(-50%);
    transition: background 0.3s ease;
}

.registration-wizard .wizard-progress .step.completed:not(:last-child)::after {
    background: #28a745;
}

.registration-wizard .wizard-step {
    display: none;
}

.registration-wizard .wizard-step.active {
    display: block;
}

.registration-wizard .form-group {
    margin-bottom: 1.5rem;
}

.registration-wizard .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.registration-wizard .form-group input,
.registration-wizard .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.registration-wizard .form-group input:focus,
.registration-wizard .form-group select:focus {
    outline: none;
    border-color: #007bff;
}

.registration-wizard .form-group input.error,
.registration-wizard .form-group select.error {
    border-color: #dc3545;
}

.registration-wizard .form-group select {
    cursor: pointer;
}

.registration-wizard .form-group select:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.registration-wizard .wizard-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    gap: 1rem;
}

/* Special case for step 1 - only next button, align right */
.registration-wizard .wizard-step[data-step="1"] + .wizard-actions {
    justify-content: flex-end;
}

/* When both buttons are visible - space between */
.registration-wizard .wizard-actions button[style*="display: none;"] ~ button {
    margin-left: 0;
}

.registration-wizard .wizard-actions #prev-btn:not([style*="display: none;"]) {
    margin-right: auto;
}

.registration-wizard .wizard-actions .btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.registration-wizard .wizard-actions .btn.btn-primary {
    background: #007bff;
    color: white;
}

.registration-wizard .wizard-actions .btn.btn-primary:hover {
    background: #0056b3;
}

.registration-wizard .wizard-actions .btn.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.registration-wizard .wizard-actions .btn.btn-secondary {
    background: #6c757d;
    color: white;
}

.registration-wizard .wizard-actions .btn.btn-secondary:hover {
    background: #545b62;
}

.registration-wizard .error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.registration-wizard .error-message.show {
    display: block;
}

.registration-wizard .loading-spinner {
    display: none;
    text-align: center;
    padding: 1rem;
}

.registration-wizard .loading-spinner.show {
    display: block;
}

.registration-wizard .loading-spinner .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Registration Form Links */
.registration-wizard ~ .text-center {
    margin-top: 2rem !important;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.registration-wizard ~ .text-center p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #666;
}

.registration-wizard ~ .text-center a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.registration-wizard ~ .text-center a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Login Form Styles - Updated from SCSS */
.login-form {
    max-width: 400px;
    margin: 120px auto 0;
    padding: 2rem;
}

.login-form .form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-form .form-header h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.login-form .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #28a745;
}

.login-form .form-group input.error {
    border-color: #dc3545;
}

.login-form .form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-form .form-check input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.login-form .form-check label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.login-form .btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.login-form .btn.btn-success {
    background: #28a745;
    color: white;
}

.login-form .btn.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.login-form .btn.btn-success:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.login-form .btn.btn-primary {
    background: #007bff;
    color: white;
}

.login-form .btn.btn-primary:hover {
    background: #0056b3;
}

.login-form .btn.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Form Links Section */
.login-form .form-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.login-form .form-links p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.login-form .form-links p:last-child {
    margin-bottom: 0;
}

.login-form .form-links a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-form .form-links a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.login-form .form-links a#forgot-password {
    color: #28a745;
    font-size: 0.85rem;
}

.login-form .form-links a#forgot-password:hover {
    color: #218838;
}

/* Alert Styles */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Error Message Styles */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Loading Spinner - Unified styles */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 1rem;
}

.loading-spinner.show {
    display: block;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* Alternative spinner for buttons */
.btn .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    margin-right: 0.5rem;
    display: none;
}

.btn.loading .spinner {
    display: inline-block;
}

/* Small loading spinner for inline use */
.loading-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-content {
    background-color: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    position: relative;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.close:hover {
    color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .col-md-6,
    .col-md-4,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .offset-md-3 {
        margin-left: 0;
    }
    
    .wizard-steps {
        flex-direction: column;
    }
    
    .wizard-step::after {
        display: none;
    }
    
    .registration-wizard,
    .login-form {
        margin: 80px 0 1rem;
        border-radius: 0;
    }
    
    .wizard-content,
    .login-form {
        padding: 1rem;
    }
    
    .container {
        padding: 0 10px;
    }
}

/* Bank Selection Styles */
.bank-option {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.bank-option:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.bank-option.selected {
    background-color: #e3f2fd;
    border-color: #007bff;
}

/* Custom Styles for Thai Banking */
.bank-logo {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    vertical-align: middle;
}

/* Link Styles */
a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}