/**
 * ARI Frontend Styles
 * Mobile-first, color palette from design brief.
 */

.ari-assessment {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 800px;
    margin: 2rem auto;
    color: #1a202c;
    line-height: 1.6;
}

.ari-screen {
    display: none;
    animation: ariFadeIn 0.35s ease-out;
}

.ari-screen.ari-active {
    display: block;
}

@keyframes ariFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.ari-assessment h2 {
    font-size: 1.875rem;
    color: #1a365d;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}

.ari-assessment h3 {
    font-size: 1.5rem;
    color: #1a365d;
    margin: 0 0 1rem;
}

.ari-tagline {
    font-style: italic;
    color: #319795;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.ari-subtitle {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* Intro */
.ari-intro-text {
    background: #f7fafc;
    border-left: 4px solid #319795;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 6px 6px 0;
}

/* Buttons */
.ari-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.5;
}

.ari-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ari-btn-primary {
    background: #1a365d;
    color: #fff;
}

.ari-btn-primary:hover:not(:disabled) {
    background: #2c5282;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(26, 54, 93, 0.15);
}

.ari-btn-secondary {
    background: #fff;
    color: #1a365d;
    border: 2px solid #1a365d;
}

.ari-btn-secondary:hover {
    background: #f7fafc;
}

/* Forms */
.ari-form-group {
    margin-bottom: 1.25rem;
}

.ari-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-size: 0.9375rem;
}

.ari-form-group input,
.ari-form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    color: #1a202c;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ari-form-group input:focus,
.ari-form-group select:focus {
    outline: none;
    border-color: #319795;
    box-shadow: 0 0 0 3px rgba(49, 151, 149, 0.12);
}

/* Progress */
.ari-progress-container {
    width: 100%;
    height: 8px;
    background: #edf2f7;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.ari-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #319795 0%, #1a365d 100%);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ari-progress-text {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Question card */
.ari-question-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ari-question-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #319795;
    background: rgba(49, 151, 149, 0.08);
    padding: 0.35rem 0.875rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.ari-question-card h3 {
    font-size: 1.25rem;
    color: #1a365d;
    margin: 0 0 1.5rem;
    line-height: 1.45;
    font-weight: 600;
}

/* Options */
.ari-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ari-option {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    margin: 0;
}

.ari-option:hover {
    border-color: #319795;
    background: #f7fafc;
}

.ari-option.ari-selected {
    border-color: #1a365d;
    background: #ebf8ff;
}

.ari-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: #1a365d;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ari-option-label {
    font-size: 1rem;
    color: #2d3748;
    line-height: 1.5;
}

/* Processing */
.ari-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #319795;
    border-radius: 50%;
    animation: ariSpin 0.9s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes ariSpin {
    to { transform: rotate(360deg); }
}

/* Results */
.ari-results-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.ari-archetype-badge {
    display: inline-block;
    background: #1a365d;
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.ari-results-header h2 {
    font-size: 1.875rem;
    margin: 0;
}

.ari-narrative {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2.5rem;
    border: 1px solid #edf2f7;
}

.ari-narrative p {
    margin: 0 0 1rem;
    font-size: 1.0625rem;
    color: #2d3748;
}

.ari-narrative p:last-child {
    margin-bottom: 0;
}

.ari-chart-container {
    position: relative;
    height: 420px;
    margin-bottom: 2.5rem;
}

.ari-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.ari-score-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: box-shadow 0.2s;
}

.ari-score-item:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.ari-score-label {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ari-score-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.ari-green { color: #38a169; }
.ari-yellow { color: #d69e2e; }
.ari-red { color: #e53e3e; }

/* Gap analysis */
.ari-gap-analysis {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2.5rem;
}

.ari-gap-analysis h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
}

.ari-gap-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid #edf2f7;
}

.ari-gap-item:last-child {
    border-bottom: none;
}

.ari-gap-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.ari-gap-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #1a365d;
    color: #fff;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ari-gap-dim {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.ari-gap-score {
    margin-left: auto;
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

.ari-gap-action {
    font-size: 0.9375rem;
    color: #4a5568;
    padding-left: 2.5rem;
    line-height: 1.5;
}

/* CTAs */
.ari-ctas {
    text-align: center;
    padding: 1rem 0 2rem;
}

/* Mobile */
@media (max-width: 640px) {
    .ari-assessment {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    .ari-assessment h2 {
        font-size: 1.5rem;
    }

    .ari-question-card {
        padding: 1.25rem;
    }

    .ari-chart-container {
        height: 320px;
    }

    .ari-ctas .ari-btn {
        display: block;
        width: 100%;
    }

    .ari-btn-secondary {
        margin-top: 0.75rem;
        margin-left: 0;
    }

    .ari-gap-action {
        padding-left: 0;
        margin-top: 0.5rem;
    }

    .ari-gap-header {
        gap: 0.5rem;
    }

    .ari-gap-score {
        margin-left: 0;
        width: 100%;
        padding-left: 2.25rem;
    }
}