/* Application Form Styling */

.physical-copy {
    margin-top: 1.5rem;
    text-align: center;
    font-style: italic;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    padding: 1rem;
}

/* Alert Messages */
.application-section .alert {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease;
}

.application-section .alert-success {
    background-color: #ecfdf5;
    border: 2px solid #10b981;
    color: #065f46;
}

.application-section .alert-error {
    background-color: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.application-section .alert-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.application-section .alert-success .alert-icon {
    color: #10b981;
}

.application-section .alert-error .alert-icon {
    color: #ef4444;
}

.application-section .alert strong {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.application-section .error-list {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.application-section .error-list li {
    margin-bottom: 0.25rem;
}

/* Field-level Error Messages */
.application-section .field-error {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #ef4444;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.375rem;
}

.application-section .form-input.error,
.application-section .form-select.error,
.application-section .form-textarea.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.application-section .form-input.error:focus,
.application-section .form-select.error:focus,
.application-section .form-textarea.error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}



/* Main Section */
.application-section {
    padding: 4rem 1rem;
    background-color: #f8fafc;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.application-container {
    width: 100%;
    max-width: 900px;
}

.application-card {
    background: #ffffff;
    border-radius: 16px;
    border: 10px solid #3993d0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    transition: transform 0.3s ease;
}

/* Header */
.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-title {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    margin-top: 0;
}

.form-subtitle {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.form-note {
    color: #64748b;
    font-size: 0.875rem;
    font-style: italic;
    line-height: 1.5;
    margin: 0;
}

/* Form Structure */
.application-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Form Sections */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

/* Form Sections */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1rem;
}

.form-section.collapsed {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

/* Section Header (Collapsible) */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
    user-select: none;
}

.section-header:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(57, 147, 208, 0.15);
}

/* Error State for Form Sections */
.form-section.has-errors .section-header {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.form-section.has-errors .section-header:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.form-section.has-errors .section-title {
    color: #dc2626;
}

.form-section.has-errors .section-title::before {
    background: #ef4444;
}

.form-section.has-errors .section-toggle .chevron {
    color: #dc2626;
}

.section-title {
    color: #3993d0;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: #f79431;
    border-radius: 2px;
}

/* Toggle Button */
.section-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.section-toggle:hover {
    background: rgba(57, 147, 208, 0.1);
}

.section-toggle .chevron {
    width: 1.5rem;
    height: 1.5rem;
    color: #3993d0;
    transition: transform 0.3s ease;
}

.form-section.collapsed .section-toggle .chevron {
    transform: rotate(-90deg);
}

/* Section Content */
.section-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem;
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
}

.form-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.section-description {
    color: #64748b;
    font-size: 0.9rem;
    margin: -0.5rem 0 0 0;
    font-style: italic;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

/* Labels */
.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-left: 0.25rem;
}

.required {
    color: #ef4444;
}

/* Input Fields */
.form-input, 
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #1e293b;
    transition: all 0.2s ease;
    outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #94a3b8;
}

.form-input:focus, 
.form-select:focus,
.form-textarea:focus {
    background-color: #ffffff;
    border-color: #3993d0;
    box-shadow: 0 0 0 4px rgba(57, 147, 208, 0.15);
}

.form-input[readonly] {
    background-color: #e2e8f0;
    cursor: not-allowed;
    color: #64748b;
}

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

/* Input Prefix (for Extension field) */
.input-prefix-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.prefix-icon {
    position: absolute;
    left: 1rem;
    color: #64748b;
    font-weight: 600;
    pointer-events: none;
}

.input-prefix-wrapper .form-input {
    padding-left: 2.25rem;
}

/* Checkbox Styling */
.checkbox-group {
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    background-color: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    margin-right: 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background-color: #3993d0;
    border-color: #3993d0;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: block;
    margin-top: -2px;
}

.checkbox-label:hover .checkbox-custom {
    border-color: #3993d0;
}

.checkbox-text {
    color: #334155;
    font-weight: 500;
    font-size: 0.95rem;
}

.checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-title {
    color: #334155;
    font-weight: 500;
    font-size: 0.95rem;
}

.checkbox-description {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

/* Radio Button Styling */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 1.25rem;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.radio-label:hover {
    border-color: #3993d0;
    background-color: #f0f9ff;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-right: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
    border-color: #3993d0;
    border-width: 2px;
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
    content: '';
    width: 12px;
    height: 12px;
    background-color: #3993d0;
    border-radius: 50%;
    display: block;
}

.radio-label input[type="radio"]:checked {
    & ~ .radio-custom {
        border-color: #3993d0;
    }
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #3993d0;
    background-color: #f0f9ff;
}

.radio-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.radio-title {
    color: #1e293b;
    font-weight: 600;
    font-size: 1rem;
}

.radio-description {
    color: #64748b;
    font-size: 0.875rem;
}

/* Reference Items */
.reference-item {
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.reference-item .btn-remove {
    position: absolute;
    right: 0;
    top: 0;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reference-item .btn-remove:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Buttons */
.btn-submit,
.btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
}

.btn-submit {
    margin-top: 1rem;
    background-color: #f79431;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(247, 148, 49, 0.2), 0 2px 4px -1px rgba(247, 148, 49, 0.1);
}

.btn-submit:hover {
    background-color: #e68522;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(247, 148, 49, 0.3), 0 4px 6px -2px rgba(247, 148, 49, 0.1);
}

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

.btn-submit:disabled {
    background-color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-submit:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #3993d0;
    color: white;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(57, 147, 208, 0.2), 0 2px 4px -1px rgba(57, 147, 208, 0.1);
}

.btn-secondary:hover {
    background-color: #2d7ab8;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(57, 147, 208, 0.3), 0 4px 6px -2px rgba(57, 147, 208, 0.1);
}

.btn-secondary:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.btn-submit:hover .btn-icon {
    transform: translateX(4px);
}

.btn-secondary:hover .btn-icon {
    transform: scale(1.1);
}

/* Trust Badge */
.application-trust {
    margin-top: 1.5rem;
    text-align: center;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
}

.trust-icon {
    width: 1rem;
    height: 1rem;
    color: #10b981;
}

.disclaimer {
    margin-top: 1.5rem;
    text-align: center;
    font-style: italic;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background-color: #f8fafc;
}

/* Conditional Field Animation */
#billing_email_group {
    overflow: hidden;
    transition: all 0.3s ease;
}

#billing_email_group.show {
    display: flex !important;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* Error States */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .application-section {
        padding: 2rem 1rem;
    }

    .application-card {
        padding: 2rem 1.5rem;
        border-width: 6px;
    }

    .form-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

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

    .btn-submit,
    .btn-secondary {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .application-card {
        padding: 1.5rem;
        border-width: 5px;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .form-subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 0.95rem;
        padding: 0.65rem 0.875rem;
    }

    .radio-label {
        padding: 1rem;
    }

    .radio-title {
        font-size: 0.95rem;
    }

    .radio-description {
        font-size: 0.8125rem;
    }
}
