/* FAM Application Wizard Styles */

.fam-application-wizard {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Progress Bar */
.fam-progress-bar {
    margin-bottom: 40px;
}

.fam-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
}

.fam-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    cursor: pointer;
}

.fam-step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.fam-step.active .fam-step-number {
    background: #0073aa;
    color: #fff;
}

.fam-step-label {
    font-size: 12px;
    margin-top: 5px;
    color: #666;
    text-align: center;
}

.fam-step.active .fam-step-label {
    color: #0073aa;
    font-weight: 600;
}

.fam-progress-bar-track {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.fam-progress-bar-fill {
    height: 100%;
    background: #0073aa;
    transition: width 0.5s ease;
}

/* Wizard Steps */
.fam-wizard-step {
    display: none;
    animation: famFadeIn 0.5s ease;
}

.fam-wizard-step.active {
    display: block;
}

@keyframes famFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fam-wizard-step h2 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #23282d;
}

/* Form Elements */
.fam-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.fam-form-group {
    margin-bottom: 15px;
}

.fam-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.fam-form-group .required {
    color: #dc3232;
}

.fam-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.fam-form-control:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

.fam-form-control.fam-error {
    border-color: #dc3232;
}

/* Plan Selection */
.fam-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.fam-plan-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.fam-plan-card:hover {
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fam-plan-card.selected {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.2);
}

.fam-plan-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.fam-plan-name {
    font-size: 18px;
    margin: 10px 0;
    color: #23282d;
}

.fam-plan-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.fam-plan-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    font-size: 13px;
    color: #555;
}

.fam-plan-details span {
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 12px;
}

.fam-plan-age-bands {
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 12px;
}

.fam-plan-age-bands .fam-band {
    display: inline-block;
    margin: 2px 5px;
    padding: 2px 8px;
    background: #e8e8e8;
    border-radius: 10px;
}

/* Buttons */
.fam-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fam-btn-primary {
    background: #0073aa;
    color: #fff;
}

.fam-btn-primary:hover {
    background: #005a87;
}

.fam-btn-primary:disabled {
    background: #b0b0b0;
    cursor: not-allowed;
}

.fam-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.fam-btn-secondary:hover {
    background: #e0e0e0;
}

.fam-btn-success {
    background: #46b450;
    color: #fff;
}

.fam-btn-success:hover {
    background: #389a41;
}

.fam-btn-outline {
    background: transparent;
    color: #0073aa;
    border: 2px solid #0073aa;
}

.fam-btn-outline:hover {
    background: #0073aa;
    color: #fff;
}

.fam-btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.fam-step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Members */
.fam-member-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.fam-member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fam-member-header h4 {
    margin: 0;
    color: #23282d;
}

.fam-primary-member {
    background: #f0f8ff;
    border-color: #0073aa;
}

/* Documents */
.fam-document-upload-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.fam-document-item {
    padding: 20px;
    border: 2px dashed #d0d0d0;
    border-radius: 6px;
    text-align: center;
}

.fam-document-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.fam-file-input {
    display: block;
    margin: 10px auto;
}

.fam-file-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.fam-upload-status {
    display: block;
    margin-top: 10px;
    font-size: 13px;
}

.fam-upload-status.fam-uploading {
    color: #f0ad4e;
}

.fam-upload-status.fam-upload-success {
    color: #46b450;
}

.fam-upload-status.fam-upload-error {
    color: #dc3232;
}

/* Review */
.fam-review-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.fam-review-section h3 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.fam-review-section p {
    margin: 8px 0;
    font-size: 14px;
}

.fam-total-premium {
    background: #0073aa;
    color: #fff;
}

.fam-total-premium h3 {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.2);
}

.fam-total-amount {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
}

/* Success Message */
.fam-success-message {
    text-align: center;
    padding: 50px 20px;
}

.fam-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.fam-success-message h2 {
    color: #46b450;
    margin-bottom: 15px;
}

.fam-success-message p {
    font-size: 16px;
    margin: 10px 0;
}

/* Loading Overlay */
.fam-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.fam-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    animation: famSpin 1s linear infinite;
}

@keyframes famSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fam-loading-overlay p {
    color: #fff;
    margin-top: 20px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .fam-form-row {
        grid-template-columns: 1fr;
    }
    
    .fam-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .fam-document-upload-area {
        grid-template-columns: 1fr;
    }
    
    .fam-step-label {
        display: none;
    }
    
    .fam-step-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .fam-step-actions .fam-btn {
        width: 100%;
    }
}

/* Selected Plan Info */
.fam-selected-plan-info {
    margin-bottom: 20px;
}

.fam-selected-plan {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.fam-selected-plan .fam-plan-icon {
    font-size: 32px;
}

.fam-selected-plan strong {
    font-size: 16px;
}

.fam-selected-plan p {
    margin: 5px 0 0;
    color: #666;
}

/* No Members */
.fam-no-members {
    text-align: center;
    padding: 30px;
    color: #666;
    background: #f9f9f9;
    border-radius: 6px;
}

/* Plan Card Selection */
.fam-plan-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.fam-plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.fam-plan-card.selected {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.2), 0 4px 15px rgba(0,0,0,0.1);
}

.fam-plan-card.selected .fam-plan-name {
    color: #0073aa;
}

.fam-plan-card .fam-select-plan {
    margin-top: 15px;
    width: 100%;
}

.fam-plan-card.selected .fam-select-plan {
    background: #0073aa;
    color: #fff;
}

/* Members Section */
.fam-members-section {
    margin-bottom: 30px;
}

.fam-members-section h3 {
    color: #23282d;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.fam-members-section h4 {
    color: #555;
    margin: 20px 0 15px;
}

.fam-primary-member-card {
    background: #f0f8ff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
}

.fam-primary-note {
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

.fam-member-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
}

.fam-member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fam-member-header h4 {
    margin: 0;
    color: #23282d;
}

.fam-spouse-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
}

.fam-no-minors,
.fam-no-extended {
    color: #999;
    padding: 15px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Member type badges */
.fam-member-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.fam-member-type-primary {
    background: #0073aa;
    color: #fff;
}

.fam-member-type-spouse {
    background: #46b450;
    color: #fff;
}

.fam-member-type-minor {
    background: #f0ad4e;
    color: #fff;
}

.fam-member-type-extended {
    background: #9b59b6;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .fam-primary-member-card {
        padding: 15px;
    }
    
    .fam-member-card {
        padding: 15px;
    }
}

/* Section Hints */
.fam-section-hint {
    color: #888;
    font-size: 13px;
    font-style: italic;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

/* Immediate Family - Specific styling */
.fam-immediate-card {
    border-left: 3px solid #9b59b6;
}

.fam-immediate-card .fam-member-header h4 {
    color: #9b59b6;
}

/* Extended Family - Specific styling */
.fam-extended-card {
    border-left: 3px solid #f39c12;
}

.fam-extended-card .fam-member-header h4 {
    color: #f39c12;
}

/* Minors - Specific styling */
.fam-minor-card {
    border-left: 3px solid #f0ad4e;
}

.fam-minor-card .fam-member-header h4 {
    color: #f0ad4e;
}

/* Spouse - Specific styling */
.fam-spouse-card {
    border-left: 3px solid #46b450;
}

/* Member type badges */
.fam-member-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.fam-member-type-primary {
    background: #0073aa;
    color: #fff;
}

.fam-member-type-spouse {
    background: #46b450;
    color: #fff;
}

.fam-member-type-minor {
    background: #f0ad4e;
    color: #fff;
}

.fam-member-type-immediate {
    background: #9b59b6;
    color: #fff;
}

.fam-member-type-extended {
    background: #f39c12;
    color: #fff;
}

/* Payout Matrix Styles */
.fam-plan-payout-matrix {
    margin: 10px 0;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 4px;
    font-size: 12px;
}

.fam-plan-payout-matrix .fam-payout {
    display: inline-block;
    margin: 2px 5px;
    padding: 2px 8px;
    background: #e8f0fe;
    border-radius: 10px;
    border: 1px solid #c5d9f0;
}

#fam-payout-selection {
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
}

#fam-payout-selection h3 {
    margin-top: 0;
    color: #23282d;
}

.fam-payout-premium-display {
    font-size: 16px;
    font-weight: bold;
    color: #0073aa;
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .fam-plan-payout-matrix .fam-payout {
        display: block;
        margin: 5px 0;
    }
}

/* Plan Configuration */
#fam-plan-configuration {
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #0073aa;
    padding: 25px;
    margin-top: 30px;
}

#fam-selected-plan-name {
    margin-top: 0;
    color: #0073aa;
    font-size: 20px;
}

#fam-premium-selection {
    margin-top: 15px;
}

#fam-premium-selection select {
    max-width: 300px;
}

#fam-payout-display {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-top: 15px;
}

.fam-payout-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.fam-payout-result > div {
    margin: 5px 0;
}

#fam-payout-amount {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-left: 10px;
}

#fam-premium-display {
    font-size: 24px;
    font-weight: bold;
    color: #46b450;
    margin-left: 10px;
}

#fam-age-band-info {
    margin-top: 10px;
    font-size: 13px;
    color: #888;
    text-align: center;
}

.fam-plan-payout-summary {
    margin: 10px 0;
    padding: 8px 12px;
    background: #f0f8ff;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.fam-plan-payout-summary strong {
    color: #0073aa;
}

/* Responsive */
@media (max-width: 768px) {
    .fam-payout-result {
        flex-direction: column;
        text-align: center;
    }
    
    #fam-premium-selection select {
        max-width: 100%;
    }
    
    #fam-plan-configuration {
        padding: 15px;
    }
}

/* Premium dropdown styling */
#fam_premium_amount option:disabled {
    color: #999;
    font-style: italic;
}

/* Age band info styling */
#fam-age-band-info {
    margin-top: 10px;
    font-size: 13px;
    color: #888;
    text-align: center;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* No premiums message */
.fam-no-premiums-msg {
    color: #dc3232;
    padding: 10px;
    background: #fef0f0;
    border-radius: 4px;
    border: 1px solid #f5c6c6;
    margin-top: 10px;
    text-align: center;
}

/* Document upload required/optional styles */
.fam-document-required {
    border-color: #0073aa;
    background: #f0f8ff;
}

.fam-document-required label .required {
    color: #dc3232;
}

.fam-document-item .optional {
    color: #888;
    font-weight: normal;
    font-size: 12px;
}

.fam-document-item .fam-upload-status {
    display: block;
    margin-top: 8px;
    font-size: 13px;
}

.fam-upload-status.fam-upload-success {
    color: #46b450;
}

.fam-upload-status.fam-upload-error {
    color: #dc3232;
}

.fam-upload-status.fam-uploading {
    color: #f0ad4e;
}