/* Apply Now Modal Styles */

/* Modal Overlay */
.apply-now-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

.apply-now-modal-overlay[style*="display: none"] {
    display: none !important;
}

.apply-now-modal-overlay.show {
    pointer-events: auto;
}

/* Backdrop */
.apply-now-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10001;
}

.apply-now-modal-overlay.show .apply-now-modal-backdrop {
    opacity: 1;
}

/* Modal Container */
.apply-now-modal-container {
    position: relative;
    z-index: 10002;
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .apply-now-modal-container {
        max-width: 32rem;
    }
}

@media (min-width: 1024px) {
    .apply-now-modal-container {
        max-width: 36rem;
    }
}

/* Modal */
.apply-now-modal {
    background: linear-gradient(to bottom right, #ffffff 0%, #f8fafc 50%, #ffffff 100%);
    border-radius: 1rem;
    border: 2px solid rgba(46, 196, 204, 0.3);
    box-shadow: 0 20px 60px rgba(11, 60, 93, 0.3), 0 0 40px rgba(46, 196, 204, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.apply-now-modal-overlay.show .apply-now-modal {
    transform: scale(1);
    opacity: 1;
}

/* Modal Header */
.apply-now-modal-header {
    position: relative;
    background: linear-gradient(to right, #0b3c5d 0%, #1a4a6b 50%, #0b3c5d 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(46, 196, 204, 0.2);
}

.apply-now-modal-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(46, 196, 204, 0.1), transparent);
    opacity: 0.5;
    pointer-events: none;
}

.apply-now-modal-header-content {
    position: relative;
    z-index: 1;
}

.apply-now-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .apply-now-modal-title {
        font-size: 1.875rem;
    }
}

.apply-now-modal-subtitle {
    font-size: 0.875rem;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .apply-now-modal-subtitle {
        font-size: 1rem;
    }
}

.apply-now-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.apply-now-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.apply-now-modal-close:active {
    transform: scale(0.95);
}

/* Modal Body */
.apply-now-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

@media (min-width: 768px) {
    .apply-now-modal-body {
        padding: 2rem;
    }
}

/* Form Styles */
.apply-now-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.apply-now-form-group {
    display: flex;
    flex-direction: column;
}

.apply-now-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.apply-now-form-required {
    color: #ef4444;
}

.apply-now-form-input,
.apply-now-form-select,
.apply-now-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    font-size: 1rem;
    color: #1f2937;
    transition: all 0.3s ease;
    font-family: inherit;
}

.apply-now-form-input:focus,
.apply-now-form-select:focus,
.apply-now-form-textarea:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(46, 196, 204, 0.1);
    border-color: var(--secondary-teal);
}

.apply-now-form-input:hover:not(:focus),
.apply-now-form-select:hover:not(:focus),
.apply-now-form-textarea:hover:not(:focus) {
    border-color: rgba(46, 196, 204, 0.5);
}

.apply-now-form-input.error,
.apply-now-form-select.error,
.apply-now-form-textarea.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.apply-now-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

.apply-now-form-textarea {
    resize: none;
    min-height: 6rem;
}

.apply-now-form-phone-wrapper {
    position: relative;
}

.apply-now-form-phone-count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: #64748b;
    pointer-events: none;
}

.apply-now-form-error {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #ef4444;
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.apply-now-form-error.show {
    display: flex;
}

.apply-now-form-submit-wrapper {
    padding-top: 0.5rem;
}

.apply-now-form-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(to right, var(--secondary-teal), var(--primary-blue));
    color: #ffffff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    transform: scale(1);
}

.apply-now-form-submit:hover:not(:disabled) {
    box-shadow: 0 25px 50px -12px rgba(46, 196, 204, 0.4);
    transform: scale(1.02);
}

.apply-now-form-submit:active:not(:disabled) {
    transform: scale(0.98);
}

.apply-now-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.apply-now-form-submit-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.apply-now-form-submit.loading {
    pointer-events: none;
}

.apply-now-form-submit.loading .apply-now-form-submit-icon {
    display: none;
}

.apply-now-form-submit.loading::before {
    content: '';
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Popup (Full Screen) */
.apply-now-success-popup {
    position: fixed;
    inset: 0;
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

.apply-now-success-popup[style*="display: none"] {
    display: none !important;
}

.apply-now-success-popup.show {
    pointer-events: auto;
}

.apply-now-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.apply-now-success-popup.show .apply-now-success-overlay {
    opacity: 1;
}

.apply-now-success-card {
    position: relative;
    background: linear-gradient(to bottom, #0b3c5d 0%, #1a4a6b 50%, #0b3c5d 100%);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 0 30px rgba(46, 196, 204, 0.3);
    border: 2px solid rgba(46, 196, 204, 0.4);
    text-align: center;
    width: 90%;
    max-width: 28rem;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.apply-now-success-popup.show .apply-now-success-card {
    transform: scale(1);
    opacity: 1;
}

@media (min-width: 640px) {
    .apply-now-success-card {
        padding: 2.5rem;
    }
}

.apply-now-success-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(46, 196, 204, 0.7);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.apply-now-success-close:hover {
    color: var(--secondary-teal);
    background: rgba(255, 255, 255, 0.1);
}

.apply-now-success-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.apply-now-success-logo-img {
    height: 3.5rem;
    width: auto;
    object-fit: contain;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.apply-now-success-icon {
    color: var(--secondary-teal);
    font-size: 3rem;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 10px rgba(46, 196, 204, 0.7));
    line-height: 1;
}

.apply-now-success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.75rem 0;
    filter: drop-shadow(0 0 8px rgba(46, 196, 204, 0.5));
}

.apply-now-success-message {
    color: #e2e8f0;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

.apply-now-success-brand {
    color: var(--secondary-teal);
    font-weight: 500;
}

.apply-now-success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.apply-now-success-contact-btn {
    background: linear-gradient(to right, var(--secondary-teal), var(--primary-blue));
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.apply-now-success-contact-btn:hover {
    box-shadow: 0 25px 50px -12px rgba(46, 196, 204, 0.4);
    transform: translateY(-2px);
}

.apply-now-success-contact-btn svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.apply-now-success-close-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.apply-now-success-close-btn:hover {
    color: var(--secondary-teal);
}

/* Error Toast (Top Right Corner) */
.apply-now-error-toast {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 10004;
    pointer-events: none;
}

.apply-now-error-toast[style*="display: none"] {
    display: none !important;
}

.apply-now-error-toast.show {
    pointer-events: auto;
}

@media (min-width: 768px) {
    .apply-now-error-toast {
        right: 2rem;
    }
}

.apply-now-error-toast-content {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 1rem;
    max-width: 28rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.apply-now-error-toast.show .apply-now-error-toast-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

@media (min-width: 768px) {
    .apply-now-error-toast-content {
        padding: 1.5rem;
    }
}

.apply-now-error-toast-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(to bottom right, #ef4444, #dc2626);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.apply-now-error-toast-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.apply-now-error-toast-text {
    flex: 1;
    min-width: 0;
}

.apply-now-error-toast-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.apply-now-error-toast-close {
    flex-shrink: 0;
    padding: 0.25rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.apply-now-error-toast-close:hover {
    background: #f1f5f9;
}

.apply-now-error-toast-close svg {
    width: 1.125rem;
    height: 1.125rem;
}

@media (max-width: 640px) {
    .apply-now-error-toast {
        right: 0.5rem;
        left: 0.5rem;
        top: 4rem;
    }
    
    .apply-now-error-toast-content {
        max-width: none;
    }
}
