/* RS26 Application Portal Styles */

/* Typography */
body, body * {
    font-family: "neue-haas-grotesk-display", sans-serif;
    letter-spacing: 0.07rem;
}

.caslon {
    font-family: "adobe-caslon-pro", serif;
    letter-spacing: 0;
}

/* Color Scheme */
.dblue {
    color: #004283;
}

.text-primary {
    color: #004283 !important;
}

.bg-primary {
    background-color: #004283 !important;
}

.btn-primary {
    background-color: #004283;
    border-color: #004283;
}

.btn-primary:hover {
    background-color: #003b6f;
    border-color: #003b6f;
}

/* Layout */
.min-h-100 {
    min-height: 100vh;
    height: auto;
}

/* Form Styling */
.form-control:focus {
    border-color: #004283;
    box-shadow: 0 0 0 0.2rem rgba(0, 66, 131, 0.25);
}

.form-control.age-invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Date input validation */
.date-input-container {
    position: relative;
}

.age-error-message {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    animation: fadeIn 0.3s ease-in;
}

.age-error-message i {
    margin-right: 0.25rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Date input specific styling */
input[type="date"] {
    position: relative;
}

input[type="date"]:invalid {
    color: #6c757d;
}

input[type="date"]:focus {
    outline: none;
}

/* Form submission loading states */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.form-submitting {
    pointer-events: none;
    opacity: 0.8;
}

.form-submitting .form-control {
    background-color: #f8f9fa;
}

/* Button loading animation */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide HTML5 validation when custom validation is active */
.form-control.age-invalid:invalid + .invalid-feedback {
    display: none;
}

.form-control.is-valid:invalid + .invalid-feedback {
    display: none;
}

.form-control.age-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Stage Indicator */
.stage-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.stage-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 200px;
}

.stage-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stage-step.active .stage-number {
    background-color: #004283;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 66, 131, 0.3);
}

.stage-step.completed .stage-number {
    background-color: #28a745;
    color: white;
    animation: completePulse 0.6s ease-out;
}

@keyframes completePulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 6px 12px rgba(40, 167, 69, 0.5);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }
}

.stage-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.stage-step.active .stage-label {
    color: #004283;
    font-weight: 700;
}

.stage-step.completed .stage-label {
    color: #28a745;
}

.stage-connector {
    height: 3px;
    background-color: #e9ecef;
    flex: 1;
    margin: 0 1rem;
    margin-top: -25px;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 1;
}

.stage-step.completed + .stage-connector {
    background-color: #28a745;
}

/* Hover effects */
.stage-step:hover .stage-number {
    transform: translateY(-2px);
}

.stage-step.active:hover .stage-number {
    transform: scale(1.1) translateY(-2px);
}

/* Success toast notification */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.success-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.success-toast i {
    color: rgba(255, 255, 255, 0.9);
}

/* Portfolio Upload Styles */
.upload-section {
    height: 100%;
}

.upload-button-container {
    text-align: center;
}

.upload-btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: 2px dashed #004283;
    background-color: transparent;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background-color: #004283;
    border-color: #004283;
    color: white;
}

.upload-progress {
    width: 100%;
}

.upload-progress .progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress .progress-bar {
    background-color: #004283;
    transition: width 0.3s ease;
}

.image-preview-container {
    width: 100%;
    position: relative;
}

.image-preview-box {
    width: 100%;
    height: 200px;
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-box:hover .preview-overlay {
    opacity: 1;
}

.replace-btn {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #004283;
    transition: all 0.3s ease;
}

.replace-btn:hover {
    background-color: white;
    transform: translateY(-2px);
}

.portfolio-item {
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Upload status indicators */
.upload-success .image-preview-box {
    border-color: #28a745;
}

.upload-error .upload-btn {
    border-color: #dc3545;
    color: #dc3545;
}

/* Payment form styling */
#payment-element {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
}

#payment-errors {
    margin-bottom: 1rem;
}

.payment-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* Success page styling */
.text-success {
    color: #28a745 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-preview-box {
        height: 150px;
    }
    
    .upload-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Age Validation Messages */
.age-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.age-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Date Input Styling */
.date-input-container {
    position: relative;
}

.date-help-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Logo Container */
.logo-container {
    width: 235px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stage-indicator {
        margin-bottom: 1.5rem;
        padding: 0.5rem 0;
    }
    
    .stage-step {
        max-width: 120px;
    }
    
    .stage-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    
    .stage-label {
        font-size: 0.8rem;
        line-height: 1.1;
    }
    
    .stage-connector {
        margin: 0 0.5rem;
        margin-top: -20px;
        height: 2px;
    }
    
    .logo-container {
        width: 200px;
    }
}

@media (max-width: 576px) {
    .stage-step {
        max-width: 80px;
    }
    
    .stage-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .stage-label {
        font-size: 0.7rem;
    }
    
    .stage-connector {
        margin: 0 0.3rem;
        margin-top: -17px;
    }
}

/* Animation for form transitions */
.form-section {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.form-section.fade-out {
    opacity: 0;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error and success message styling */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Form validation improvements */
.was-validated .form-control:valid {
    border-color: #28a745;
    background-image: none;
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
    background-image: none;
}