/*
 * Registration CSS
 * Isolated styles for candidate registration flow
 * NO DASHBOARD DEPENDENCIES
 */

/* Reset any inherited dashboard styles */
* {
    box-sizing: border-box;
}

/* Ensure no dashboard chrome is visible */
.dashboard-sidebar,
.candidate-sidebar,
.sidebar-backdrop,
.breadcrumb,
.candidate-main {
    display: none !important;
}

/* Registration-specific layout */
.registration-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.registration-card {
    width: 100%;
    max-width: 480px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.registration-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Form styling with responsive improvements */
.registration-form {
    padding: 0;
    width: 100%;
}

/* Improved form group spacing */
.form-group {
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .form-group {
        margin-bottom: 1.25rem;
    }
}

/* Row improvements for mobile */
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

@media (min-width: 768px) {
    .row {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }
    
    .row > * {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

.form-floating {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control {
    height: calc(3.5rem + 2px);
    line-height: 1.25;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #6366f1;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

.form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: #6c757d;
    font-weight: 500;
}

.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: #6366f1;
}

/* Button styling */
.btn-registration {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-registration:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
}

.btn-registration:active {
    transform: translateY(0);
}

.btn-registration:focus {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4), 0 0 0 0.25rem rgba(99, 102, 241, 0.5);
}

/* Success button variant */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

/* Alert styling with responsive improvements */
.alert {
    border-radius: 0.75rem;
    border: none;
    backdrop-filter: blur(10px);
    font-weight: 500;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
}

@media (max-width: 767px) {
    .alert {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
        margin-bottom: 1.25rem;
    }
}

@media (min-width: 768px) {
    .alert {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Invalid feedback with responsive improvements */
.invalid-feedback {
    color: #ef4444;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.invalid-feedback::before {
    content: '⚠';
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .invalid-feedback {
        font-size: 0.875rem;
        margin-top: 0.25rem;
    }
}

/* Form validation states */
.form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.form-control.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25);
}

.valid-feedback {
    color: #10b981;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.valid-feedback::before {
    content: '✓';
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .valid-feedback {
        font-size: 0.875rem;
        margin-top: 0.25rem;
    }
}

/* Text links */
.text-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.text-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive - Mobile-first design */
/* Base styles for mobile (320px+) */
.registration-container {
    padding: 0.5rem;
    min-height: 100vh;
}

.registration-card {
    margin: 0.5rem auto;
    max-width: 100%;
    border-radius: 1rem;
    min-height: auto;
}

/* Touch-friendly form controls */
.form-control {
    height: calc(3.5rem + 2px);
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 1rem 0.875rem;
    touch-action: manipulation;
    -webkit-appearance: none;
}

.btn-registration,
.btn-success {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 3rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Tablet responsive (768px+) */
@media (min-width: 768px) {
    .registration-container {
        padding: 1rem;
    }
    
    .registration-card {
        margin: 1rem auto;
        max-width: 540px;
        border-radius: 1.25rem;
    }
    
    .form-control {
        height: calc(3.5rem + 2px);
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .btn-registration,
    .btn-success {
        padding: 0.875rem 2rem;
        font-size: 1.1rem;
    }
}

/* Desktop responsive (992px+) */
@media (min-width: 992px) {
    .registration-container {
        padding: 2rem 1rem;
    }
    
    .registration-card {
        margin: 2rem auto;
        max-width: 480px;
        border-radius: 1.5rem;
    }
    
    .form-control {
        height: calc(3.5rem + 2px);
        font-size: 1rem;
    }
    
    .btn-registration,
    .btn-success {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* Large desktop (1200px+) */
@media (min-width: 1200px) {
    .registration-card {
        max-width: 520px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }
    
    .form-control:focus {
        border-width: 3px;
        box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.5);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .registration-card,
    .btn-registration,
    .btn-success,
    .form-control,
    .text-link {
        transition: none;
    }
    
    .btn-registration:hover,
    .btn-success:hover,
    .registration-card:hover {
        transform: none;
    }
    
    .btn-loading::after {
        animation: none;
    }
}

/* Progress Indicators */
.progress-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 1rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1.25rem;
    left: 60%;
    right: -40%;
    height: 3px;
    background: #e5e7eb;
    border-radius: 1.5px;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.progress-step.completed::after {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-step.active::after {
    background: linear-gradient(90deg, #e5e7eb 0%, #10b981 50%);
    animation: progress-fill 0.5s ease-in-out;
}

.progress-step-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #f3f4f6;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    z-index: 2;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-step.active .progress-step-circle {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transform: scale(1.1);
}

.progress-step.completed .progress-step-circle {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}

.progress-step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.progress-step.active .progress-step-label {
    color: #6366f1;
    font-weight: 600;
}

.progress-step.completed .progress-step-label {
    color: #10b981;
    font-weight: 600;
}

@keyframes progress-fill {
    from {
        background: linear-gradient(90deg, #e5e7eb 0%, #e5e7eb 100%);
    }
    to {
        background: linear-gradient(90deg, #e5e7eb 0%, #10b981 50%);
    }
}

/* Mobile progress steps */
@media (max-width: 767px) {
    .progress-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 1rem 0.5rem;
        justify-content: center;
    }
    
    .progress-step {
        flex: 0 0 calc(33.333% - 0.333rem);
        min-width: auto;
    }
    
    .progress-step:not(:last-child)::after {
        display: none;
    }
    
    .progress-step-circle {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    
    .progress-step.active .progress-step-circle {
        transform: scale(1.05);
    }
    
    .progress-step-label {
        font-size: 0.6875rem;
    }
}

/* Tablet progress steps */
@media (min-width: 768px) and (max-width: 991px) {
    .progress-step-circle {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .progress-step-label {
        font-size: 0.6875rem;
    }
}

/* Step content container */
.step-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

@media (max-width: 767px) {
    .step-content {
        padding: 1.5rem;
        border-radius: 0.875rem;
    }
}

/* CV Upload Component - Touch-friendly mobile design */
.cv-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 1rem;
    padding: 2rem 1rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 12rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-upload-area:hover {
    border-color: #6366f1;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.cv-upload-area:active {
    transform: translateY(0);
}

.cv-upload-area.file-selected {
    border-color: #10b981;
    background: #f0fdf4;
    border-style: solid;
}

.cv-upload-area.drag-over {
    border-color: #6366f1;
    background: #eef2ff;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
    width: 100%;
}

.upload-icon {
    margin-bottom: 1rem;
}

.upload-icon i {
    font-size: 3rem;
    color: #6366f1;
    opacity: 0.7;
}

.upload-title {
    color: #374151;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.upload-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.selected-file {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.selected-file i {
    color: #10b981;
    font-size: 1.25rem;
}

.filename {
    font-weight: 600;
    color: #374151;
    word-break: break-word;
}

.file-size {
    color: #6b7280;
    font-size: 0.8125rem;
}

/* Mobile CV upload optimizations */
@media (max-width: 767px) {
    .cv-upload-area {
        padding: 1.5rem 1rem;
        min-height: 10rem;
        border-radius: 0.875rem;
    }
    
    .upload-icon i {
        font-size: 2.5rem;
    }
    
    .upload-title {
        font-size: 1rem;
    }
    
    .upload-subtitle {
        font-size: 0.8125rem;
    }
    
    .selected-file {
        padding: 0.875rem;
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
    
    .filename {
        font-size: 0.9375rem;
        text-align: center;
    }
    
    .file-size {
        font-size: 0.75rem;
    }
}

/* Tablet CV upload optimizations */
@media (min-width: 768px) and (max-width: 991px) {
    .cv-upload-area {
        padding: 2rem 1.5rem;
        min-height: 11rem;
    }
    
    .upload-title {
        font-size: 1.0625rem;
    }
}

/* File input styling */
input[type="file"] {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

/* Drag and drop feedback */
.cv-upload-area.drag-over::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.05);
    border-radius: inherit;
    pointer-events: none;
}

/* Upload progress indicator */
.upload-progress {
    margin-top: 1rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    height: 0.5rem;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar {
    background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%);
    height: 100%;
    border-radius: inherit;
    transition: width 0.3s ease;
    position: relative;
}

.upload-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Accessibility Enhancements */
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Focus indicators */
*:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
        border-color: #000;
    }
    
    .form-control:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.8);
    }
    
    .btn-registration,
    .btn-success {
        border: 2px solid #000;
    }
    
    .progress-step-circle {
        border: 2px solid #000;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .registration-card,
    .btn-registration,
    .btn-success,
    .form-control,
    .text-link,
    .cv-upload-area {
        transition: none !important;
        animation: none !important;
    }
    
    .btn-registration:hover,
    .btn-success:hover,
    .registration-card:hover,
    .cv-upload-area:hover {
        transform: none !important;
    }
    
    .progress-fill,
    .progress-shine {
        animation: none !important;
    }
}

/* Large text support */
@media (min-resolution: 192dpi) {
    .form-control,
    .btn-registration,
    .btn-success {
        font-size: 18px;
        line-height: 1.4;
    }
}

/* Color blind accessibility */
.form-control.is-invalid {
    border-color: #dc3545;
    border-style: dashed;
    border-width: 2px;
}

.form-control.is-valid {
    border-color: #28a745;
    border-style: solid;
    border-width: 2px;
}

/* Error announcement region */
.error-announcement {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 300px;
}

@media (max-width: 767px) {
    .error-announcement {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Print styles */
@media print {
    .registration-header,
    footer,
    .btn-registration,
    .btn-success,
    .progress-container,
    .skip-link,
    .error-announcement {
        display: none;
    }
    
    .registration-card {
        box-shadow: none;
        background: white;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: #000;
    }
    
    .form-control {
        border: 1px solid #000;
        background: white;
        color: #000;
    }
}