/* Apply Page Styles */

* {
    box-sizing: border-box;
}

.apply-header {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.95) 0%, rgba(59, 130, 246, 0.9) 100%),
                url('https://images.unsplash.com/photo-1450101499163-c8848c66ca85?w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 140px 0 80px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.apply-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.apply-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: slideInDown 0.8s ease;
}

.apply-header p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    animation: slideInUp 0.8s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Application Steps */
.application-steps {
    background: white;
    padding: 2.5rem 0;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.steps-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    flex: 1;
}

.step::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 60%;
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #cbd5e1 0%, #e2e8f0 100%);
    z-index: 0;
}

.step:last-child::after {
    display: none;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    border: 3px solid transparent;
}

.step-number.active {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.4);
    transform: scale(1.15);
    border-color: white;
    animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(30, 64, 175, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(30, 64, 175, 0.6);
    }
}

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

.step-number.completed::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
}

.step p {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.step.active p {
    color: #1e40af;
    font-weight: 700;
}

/* Application Section */
.application-section {
    padding: 3rem 0;
    background: #f8fafc;
    min-height: 60vh;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Service Selection Grid */
.services-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.service-selection-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.service-selection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #3b82f6 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-selection-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
}

.service-selection-card:hover::before {
    transform: scaleX(1);
}

.service-selection-card.selected {
    border-color: #1e40af;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.3);
    transform: translateY(-4px);
}

.service-selection-card.selected::before {
    transform: scaleX(1);
}

.service-selection-card.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.service-selection-card .service-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.service-selection-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.35);
}

.service-selection-card .service-icon i {
    font-size: 1.75rem;
    color: white;
}

.service-selection-card h3 {
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.service-selection-card:hover h3 {
    color: #1e40af;
}

.service-selection-card p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.service-selection-card .service-price {
    color: #1e40af;
    font-weight: 700;
    font-size: 1rem;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(30, 64, 175, 0.1);
    border-radius: 8px;
}

.service-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.service-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Form Header */
.form-header {
    margin-bottom: 2rem;
}

.btn-back {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    color: #1e40af;
    transform: translateX(-4px);
}

.form-header h2 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #64748b;
}

/* Application Form */
.application-form {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: #1e40af;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.form-section h3 i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: #334155;
    font-size: 0.95rem;
}

.form-group label .required {
    color: #dc2626;
    margin-left: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #cbd5e1;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 2px solid #f1f5f9;
}

/* Enhanced Buttons */
.btn {
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Review Section */
.review-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.review-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.review-section:last-child {
    border-bottom: none;
}

.review-section h3 {
    color: #1e40af;
    margin-bottom: 1rem;
}

.review-value {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 500;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.review-grid div {
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
}

.review-grid strong {
    color: #64748b;
    font-size: 0.9rem;
}

.review-grid span {
    color: #1e293b;
    margin-left: 0.5rem;
}

.terms-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
    line-height: 1.6;
}

.checkbox-label a {
    color: #3b82f6;
    text-decoration: underline;
}

/* Success Container */
.success-container {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 4rem 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.success-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    animation: rotateGradient 10s linear infinite;
}

@keyframes rotateGradient {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.success-icon {
    font-size: 5rem;
    color: #10b981;
    margin-bottom: 2rem;
    display: inline-block;
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}

@keyframes successPop {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-container h2 {
    color: #1e293b;
    margin-bottom: 1.25rem;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.success-container p {
    color: #64748b;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.application-ref {
    display: inline-block;
    padding: 1.5rem 2.5rem;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 12px;
    margin: 2rem 0;
    border: 3px dashed #3b82f6;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease 0.4s both;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.application-ref strong {
    color: #1e40af;
    font-size: 1.05rem;
    display: block;
    margin-bottom: 0.5rem;
}

.application-ref span {
    color: #1e293b;
    font-family: 'Courier New', monospace;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.success-note {
    font-size: 0.95rem;
    color: #64748b;
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    max-width: 600px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease 0.5s both;
}

.success-actions {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 2.5rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease 0.6s both;
}

/* Loading Animation */
.service-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.service-loading i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1.5rem;
    animation: spin 1s linear infinite;
}

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

.service-loading p {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 2rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e40af 0%, #3b82f6 100%);
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Helper Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Responsive */
@media (max-width: 768px) {
    .apply-header {
        padding: 100px 0 50px;
        background-attachment: scroll;
    }

    .apply-header h1 {
        font-size: 2rem;
    }

    .apply-header p {
        font-size: 1rem;
    }

    .steps-container {
        gap: 2rem;
    }

    .step::after {
        width: 2rem;
        height: 2px;
    }

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .step p {
        font-size: 0.85rem;
    }

    .services-selection-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .service-selection-card {
        padding: 1.5rem;
    }

    .application-form {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .review-container {
        padding: 1.5rem;
    }

    .success-container {
        padding: 2.5rem 1.5rem;
    }

    .success-icon {
        font-size: 3.5rem;
    }

    .success-container h2 {
        font-size: 1.5rem;
    }

    .application-ref {
        padding: 1rem 1.5rem;
    }

    .application-ref span {
        font-size: 1.1rem;
    }

    .success-actions {
        flex-direction: column;
        width: 100%;
    }

    .success-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .apply-header h1 {
        font-size: 1.75rem;
    }

    .steps-container {
        gap: 1rem;
    }

    .step::after {
        width: 1rem;
    }

    .step-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .step p {
        font-size: 0.75rem;
    }

    .service-selection-card .service-icon {
        width: 60px;
        height: 60px;
    }

    .service-selection-card h3 {
        font-size: 1.05rem;
    }

    .form-section h3 {
        font-size: 1.15rem;
    }
}

/* Print Styles */
@media print {
    .apply-header,
    .application-steps,
    nav,
    footer,
    .form-actions,
    .success-actions {
        display: none;
    }

    .success-container,
    .review-container {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}
