/**
 * Frontend Styles
 *
 * @package QualitaetsunternehmenCert
 */

/* Galano Grotesque font loaded via wp_enqueue_style in class-qde-plugin.php */

/* Base Typography */
body, .qde-application-form, .qde-form-section, .qde-form-group {
    font-family: 'Galano Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4, h5, h6,
.qde-form-section h2,
.qde-form-section h3,
.step-label,
.qde-btn {
    font-family: 'Galano Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
}

/* Application Form Container */
.qde-application-form {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px;
}

/* Progress Steps */
.qde-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.qde-progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

/* Filled progress bar behind circles */
.qde-progress-steps .qde-progress-fill {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    width: 0%;
    background: #0f2844;
    z-index: 0;
    transition: width 0.3s ease;
}

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

.qde-progress-step .step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.qde-progress-step .step-label {
    font-size: 12px;
    color: #666;
}

.qde-progress-step.active .step-circle {
    background: #0f2844 !important;
    background-color: #0f2844 !important;
    border-color: #0f2844 !important;
    color: #fff !important;
}

.qde-progress-step.completed .step-circle {
    background: #0f2844 !important;
    background-color: #0f2844 !important;
    border-color: #0f2844 !important;
    color: #fff !important;
}

/* Make previous steps clearly clickable */
.qde-progress-step.clickable { cursor: pointer; }
.qde-progress-step.clickable .step-circle { border-color: #0f2844; }
.qde-progress-step.clickable:hover .step-circle {
    background: #f0f6fc;
    color: #0f2844;
}

/* Highlight active step label */
.qde-progress-step.active .step-label { color: #0f2844; font-weight: 600; }
.qde-progress-step.completed .step-label { color: #0f2844; }

/* Form Sections */
.qde-form-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 48px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Ensure consistent step headers across all steps */
.qde-form-section .step-header h2 {
    font-family: 'Galano Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0f2844;
    font-weight: 700;
    margin: 0 0 8px 0;
}
.qde-form-section .step-header .step-description {
    font-family: 'Galano Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.qde-form-section h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.qde-form-section .section-description {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.6;
}

/* Form Fields */
.qde-form-row {
    margin-bottom: 20px;
}

.qde-form-row.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.qde-form-group {
    margin-bottom: 20px;
}

.qde-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 18px;
}

.qde-form-group label .required {
    color: #d63638;
}

.qde-form-group input[type="text"],
.qde-form-group input[type="email"],
.qde-form-group input[type="url"],
.qde-form-group input[type="tel"],
.qde-form-group input[type="number"],
.qde-form-group select,
.qde-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 17px;
    transition: border-color 0.2s;
}

.qde-form-group input:focus,
.qde-form-group select:focus,
.qde-form-group textarea:focus {
    outline: none;
    border-color: #0f2844;
}

.qde-form-group .field-hint {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.qde-form-group .field-error {
    font-size: 14px;
    color: #d63638;
    margin-top: 5px;
}

/* File Upload */
.qde-file-upload {
    border: 2px dashed #ddd;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: border-color 0.2s;
    cursor: pointer;
}

.qde-file-upload:hover {
    border-color: #0f2844;
}

.qde-file-upload.dragover {
    border-color: #0f2844;
    background: #f0f6fc;
}

.qde-file-upload input[type="file"] {
    display: none;
}

.qde-file-upload-icon {
    font-size: 48px;
    color: #666;
    margin-bottom: 10px;
}

.qde-uploaded-files {
    margin-top: 15px;
}

.qde-uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-bottom: 10px;
}

/* Checkbox and Radio */
.qde-checkbox-group,
.qde-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qde-checkbox-item,
.qde-radio-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.qde-checkbox-item input[type="checkbox"],
.qde-radio-item input[type="radio"] {
    margin-top: 3px;
}

/* Sworn Statement */
.qde-sworn-statement {
    background: #f8f9fa;
    border-left: 4px solid #0f2844;
    padding: 20px;
    margin: 20px 0;
}

.qde-sworn-statement h3 {
    margin: 0 0 15px 0;
}

.qde-sworn-statement .statement-text {
    line-height: 1.6;
    margin-bottom: 20px;
}

.qde-sworn-acceptance {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 15px;
    background: #fff;
}

.qde-sworn-acceptance label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.qde-sworn-acceptance input[type="checkbox"] {
    margin-top: 3px;
}

/* Navigation Buttons */
.qde-form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 30px;
}

.qde-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 80px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.qde-btn-primary {
    background: #0f2844;
    color: #fff;
}

.qde-btn-primary:hover {
    background: #0b1f36;
}

.qde-btn-secondary {
    background: rgba(15, 40, 68, 0.1);
    color: #0f2844;
    border: 2px solid #0f2844;
}

.qde-btn-secondary:hover {
    background: rgba(15, 40, 68, 0.15);
}

.qde-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Verification Page */
.qde-verification-card {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.qde-verification-status {
    margin-bottom: 30px;
}

.qde-status-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.qde-status-icon.valid {
    color: #00a32a;
}

.qde-status-icon.invalid {
    color: #d63638;
}

.qde-verification-details {
    text-align: left;
    margin-top: 30px;
}

.qde-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.qde-detail-row:last-child {
    border-bottom: none;
}

.qde-detail-row .label {
    font-weight: 600;
    color: #666;
}

.qde-detail-row .value {
    color: #1d2327;
}

/* Loading State */
.qde-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.qde-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #0f2844;
    animation: qde-spin 0.8s linear infinite;
}

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

/* Responsive */
@media screen and (max-width: 768px) {
    .qde-form-row.two-columns {
        grid-template-columns: 1fr;
    }

    /* Keep progress steps in single row on mobile */
    .qde-progress-steps {
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    .qde-progress-step {
        flex: 1 1 auto;
        min-width: 60px;
        margin-bottom: 0;
    }

    .qde-progress-step .step-circle {
        width: 32px;
        height: 32px;
        font-size: 13px;
        line-height: 32px;
        margin: 0 auto 8px;
    }

    .qde-progress-step .step-label {
        font-size: 9px;
        margin-top: 4px;
        line-height: 1.2;
    }

    /* Progress bar positioning for smaller circles */
    .qde-progress-steps::before {
        top: 16px;
    }

    .qde-progress-steps .qde-progress-fill {
        top: 16px;
    }

    .qde-form-section {
        padding: 20px;
    }

    .qde-verification-card {
        margin: 20px;
        padding: 20px;
    }

    .qde-application-form {
        padding: 12px;
    }
}
