/**
 * Public Styles - Standalone Form
 *
 * @package Altitude_Audit
 */

/* =======================
   FORM WRAPPER
   ======================= */

.altitude-audit-form-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* =======================
   FORM HEADER
   ======================= */

.altitude-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.altitude-form-header h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 15px;
}

/* =======================
   FORM SECTIONS
   ======================= */

.altitude-form-section {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.altitude-category-section h3 {
    font-size: 28px;
    color: #667eea;
    margin-top: 0;
    margin-bottom: 10px;
}

.category-description {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
}

/* =======================
   PERSONAL INFO FIELDS
   ======================= */

.altitude-personal-info .altitude-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.altitude-form-field {
    margin-bottom: 20px;
}

.altitude-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.altitude-form-field .required {
    color: #e74c3c;
}

.altitude-form-field input[type="text"],
.altitude-form-field input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.altitude-form-field input[type="text"]:focus,
.altitude-form-field input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
}

.altitude-form-field small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 14px;
}

/* =======================
   QUIZ QUESTIONS
   ======================= */

.altitude-question-wrapper {
    margin-bottom: 30px;
    padding: 25px;
    background: #f7f9fc;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.altitude-question-wrapper.answered {
    border-color: #667eea;
    background: #f0f3ff;
}

.altitude-question-wrapper fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.altitude-question-wrapper legend {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding: 0;
}

.altitude-question-wrapper legend .required {
    color: #e74c3c;
}

/* =======================
   RADIO BUTTONS
   ======================= */

.altitude-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.altitude-radio-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.altitude-radio-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.altitude-radio-option input[type="radio"] {
    margin: 0;
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.altitude-radio-option input[type="radio"]:checked + .radio-label {
    font-weight: 600;
    color: #667eea;
}

.altitude-radio-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.radio-label {
    font-size: 16px;
    color: #333;
    cursor: pointer;
    flex: 1;
}

/* =======================
   BUTTONS
   ======================= */

.altitude-form-submit {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.altitude-btn {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.altitude-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.altitude-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.altitude-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.altitude-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.altitude-btn-secondary:hover {
    background: #e5e5e5;
}

/* =======================
   PROGRESS BAR
   ======================= */

.altitude-progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-top: 30px;
    overflow: hidden;
}

.altitude-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.4s ease;
}

.altitude-progress-text {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.altitude-progress-text #answered-count {
    font-weight: bold;
    color: #667eea;
}

/* =======================
   AUDIT RESULTS DISPLAY
   ======================= */

.altitude-audit-results,
.altitude-audit-results-history {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.altitude-audit-results-header {
    text-align: center;
    margin-bottom: 40px;
}

.altitude-audit-results-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.result-date {
    color: #666;
    font-size: 14px;
}

.altitude-audit-type-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.altitude-audit-type-card h3 {
    margin-top: 0;
    font-size: 18px;
    opacity: 0.9;
}

.type-badge {
    font-size: 32px;
    font-weight: bold;
    margin: 20px 0;
}

.type-description {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

.altitude-audit-scores {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.altitude-audit-scores h3 {
    margin-top: 0;
    color: #333;
}

.score-bars {
    margin: 20px 0;
}

.score-bar-item {
    margin-bottom: 20px;
}

.score-bar-item.highest-score .score-label {
    color: #667eea;
    font-weight: bold;
}

.score-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.score-value {
    font-weight: bold;
}

.score-bar-container {
    background: #f0f0f0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.score-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.6s ease;
}

.score-bar-item.highest-score .score-bar {
    background: linear-gradient(135deg, #f0ad4e 0%, #ec971f 100%);
}

.total-score {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    font-size: 18px;
}

.altitude-audit-cta {
    text-align: center;
}

.altitude-audit-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.altitude-audit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

/* =======================
   RESULTS HISTORY
   ======================= */

.results-timeline {
    display: grid;
    gap: 20px;
}

.result-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    gap: 20px;
    align-items: center;
}

.result-card .result-date {
    color: #666;
    font-size: 14px;
}

.result-card .result-type {
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

.result-card .result-score {
    text-align: right;
    color: #333;
}

/* =======================
   MESSAGES
   ======================= */

.altitude-audit-message,
.altitude-audit-error {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.altitude-audit-message {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.altitude-audit-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =======================
   MANDATORY ACCEPTANCE CHECKBOX
   ======================= */

.altitude-acceptance {
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.altitude-acceptance.has-error {
    border-color: #e74c3c;
}

.altitude-acceptance-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.altitude-acceptance-field input[type="checkbox"] {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin: 2px 0 0 0;
    cursor: pointer;
    accent-color: #667eea;
}

.altitude-acceptance-field label {
    flex: 1;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    cursor: pointer;
}

.altitude-acceptance-field label a {
    color: #667eea;
    text-decoration: underline;
}

.altitude-acceptance-field .required {
    color: #e74c3c;
}

.altitude-acceptance-field input[type="checkbox"]:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.altitude-acceptance-error {
    margin: 12px 0 0 34px;
    color: #c0392b;
    font-size: 15px;
    font-weight: 600;
}

.altitude-acceptance-error[hidden] {
    display: none;
}

/* =======================
   RESPONSIVE DESIGN
   ======================= */

@media (max-width: 768px) {
    .altitude-personal-info .altitude-form-row {
        grid-template-columns: 1fr;
    }

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

    .altitude-question-wrapper {
        padding: 20px;
    }

    .altitude-question-wrapper legend {
        font-size: 16px;
    }

    .altitude-radio-option {
        padding: 12px 15px;
    }

    .radio-label {
        font-size: 15px;
    }

    .altitude-form-submit {
        flex-direction: column;
    }

    .altitude-acceptance-field label {
        font-size: 15px;
    }

    .altitude-acceptance-error {
        margin-left: 0;
    }

    .altitude-btn {
        width: 100%;
    }

    .result-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .result-card .result-score {
        text-align: left;
    }

    .altitude-audit-type-card {
        padding: 30px 20px;
    }

    .altitude-audit-scores {
        padding: 20px;
    }
}

/* =======================
   ACCESSIBILITY
   ======================= */

.altitude-btn:focus,
.altitude-radio-option:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* =======================
   PRINT STYLES
   ======================= */

@media print {
    .altitude-audit-cta {
        display: none;
    }

    .altitude-audit-type-card {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .score-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .altitude-form-submit {
        display: none;
    }

    .altitude-progress-bar,
    .altitude-progress-text {
        display: none;
    }
}
