:root {
    --aws-dark: #232F3E;
    --aws-orange: #FF9900;
    --aws-orange-hover: #EC7211;
    --aws-light: #F2F3F3;
    --aws-blue: #1B659D;
    --text-primary: #16191F;
    --text-secondary: #545B64;
    --border: #D5DBDB;
    --success: #1D8102;
    --warning: #D13212;
    --info: #0073BB;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Amazon Ember', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--aws-light);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
}

.screen { display: none; min-height: 100vh; padding: 40px 20px; }
.screen.active { display: flex; align-items: center; justify-content: center; }
#assessment.active { align-items: flex-start; padding-top: 80px; }
#loading.active { align-items: flex-start; padding-top: 80px; }
#report.active { align-items: flex-start; padding-top: 80px; }

.container { max-width: 800px; width: 100%; margin: 0 auto; }
.container.narrow { max-width: 520px; }
.container.center { text-align: center; }

/* Landing */
.logo-area { text-align: center; margin-bottom: 16px; }
.logo-area h1 { font-size: 38px; color: var(--aws-dark); margin-top: 12px; }
.subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 40px; font-size: 17px; max-width: 600px; margin-left: auto; margin-right: auto; }

.profile-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.profile-card {
    background: #fff; border: 2px solid var(--border); border-radius: 12px;
    padding: 32px 24px; cursor: pointer; transition: all 0.2s; text-align: center;
    font-family: inherit;
}
.profile-card:hover { border-color: var(--aws-orange); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.profile-icon { margin-bottom: 16px; }
.profile-card h2 { font-size: 22px; margin-bottom: 8px; color: var(--aws-dark); }
.profile-card p { color: var(--text-secondary); font-size: 15px; margin-bottom: 16px; }
.badge { display: inline-block; background: var(--aws-orange); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* Progress */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--aws-orange); border-radius: 3px; transition: width 0.3s; width: 0%; }
.progress-text { text-align: right; font-size: 13px; color: var(--text-secondary); margin-bottom: 32px; }

/* Questions */
/* Question transition */
#questionArea {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#questionArea.fade-out {
    opacity: 0;
    transform: translateX(-12px);
}
#questionArea.fade-in {
    opacity: 0;
    transform: translateX(12px);
}

.category-badge { display: inline-block; background: var(--aws-dark); color: #fff; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
#questionText { font-size: 24px; margin-bottom: 24px; color: var(--aws-dark); }

.option {
    display: block; width: 100%; text-align: left; background: #fff; border: 2px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; cursor: pointer;
    font-size: 15px; font-family: inherit; color: var(--text-primary); transition: all 0.15s;
}
.option:hover { border-color: var(--aws-orange); background: #FFF8F0; }
.option.selected { border-color: var(--aws-orange); background: #FFF3E0; font-weight: 500; }
.option:focus-visible { outline: 3px solid var(--aws-blue); outline-offset: 2px; }

/* Nav */
.nav-buttons { display: flex; justify-content: space-between; margin-top: 32px; }
.btn {
    padding: 12px 32px; border-radius: var(--radius); font-size: 15px; font-weight: 600;
    cursor: pointer; border: none; font-family: inherit; transition: all 0.15s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--aws-orange); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--aws-orange-hover); }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 2px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text-secondary); }
.btn.full-width { width: 100%; }

/* Loading */
.spinner {
    width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--aws-orange);
    border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading h2 { margin-bottom: 8px; }
#loading p { color: var(--text-secondary); }

.loading-card {
    max-width: 520px; margin: 24px auto 0; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.loading-progress-bar {
    height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 24px;
}
.loading-progress-fill {
    height: 100%; width: 5%; background: var(--aws-orange); border-radius: 3px;
    transition: width 0.6s ease;
}
.loading-steps { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.loading-step {
    display: flex; align-items: center; gap: 14px; opacity: 0.4; transition: opacity 0.4s ease;
}
.loading-step.active { opacity: 1; }
.loading-step.done { opacity: 0.7; }
.loading-step-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.spinner-sm {
    width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--aws-orange);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loading-step-dot {
    width: 10px; height: 10px; background: var(--border); border-radius: 50%;
}
.loading-step-check { color: var(--success); font-size: 18px; font-weight: 700; }
.loading-step-text { display: flex; flex-direction: column; gap: 2px; }
.loading-step-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.loading-step-sub { font-size: 12px; color: var(--text-secondary); }
.loading-time {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary);
    padding: 10px 14px; background: var(--aws-light); border-radius: 8px; margin-bottom: 16px;
}
.loading-time-icon { font-size: 15px; }
.loading-tip {
    font-size: 13px; color: var(--text-secondary); line-height: 1.5;
    min-height: 40px; transition: opacity 0.4s ease;
    padding: 10px 14px; background: #f0f4f8; border-radius: 8px; border-left: 3px solid var(--aws-orange);
}
.loading-safe-to-leave {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--aws-orange);
    font-weight: 500; margin-top: 16px; padding: 10px 14px;
    background: #fff8f0; border-radius: 8px; border: 1px solid #ffe0b2;
    animation: fadeInUp 0.5s ease;
}
.loading-safe-icon { font-size: 15px; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Report */
.report-header { text-align: center; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 2px solid var(--border); }
.report-header h1 { font-size: 28px; color: var(--aws-dark); }
.report-meta { color: var(--text-secondary); font-size: 14px; margin-top: 8px; }

.report-section { background: #fff; border-radius: 12px; padding: 28px; margin-bottom: 20px; border: 1px solid var(--border); }
.report-section h2 { font-size: 20px; color: var(--aws-dark); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--aws-orange); }
.report-section h3 { font-size: 15px; color: var(--aws-dark); margin: 16px 0 8px; }
.report-section p, .report-section li { font-size: 15px; color: var(--text-primary); line-height: 1.7; }
.report-section ul { padding-left: 20px; margin: 8px 0; }
.report-section li { margin-bottom: 6px; }

.score-display { text-align: center; padding: 32px; }
.score-circle {
    width: 140px; height: 140px; border-radius: 50%; display: inline-flex; align-items: center;
    justify-content: center; font-size: 42px; font-weight: 700; color: #fff; margin-bottom: 12px;
}
.score-circle.high { background: var(--success); }
.score-circle.medium { background: var(--aws-orange); }
.score-circle.low { background: var(--warning); }
.score-label { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.pillar-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pillar-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--aws-light); border-radius: var(--radius); }
.pillar-item .label { font-size: 13px; font-weight: 600; }
.pillar-item .value { font-size: 14px; font-weight: 700; }

.action-item { padding: 12px 16px; background: #FFF8F0; border-left: 4px solid var(--aws-orange); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 10px; }
.action-item .priority { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.action-item .priority.high { color: var(--warning); }
.action-item .priority.medium { color: var(--aws-orange); }
.action-item .priority.low { color: var(--success); }

.report-actions { text-align: center; margin-top: 32px; display: flex; gap: 16px; justify-content: center; }

@media (max-width: 640px) {
    .profile-cards { grid-template-columns: 1fr; }
    .pillar-scores { grid-template-columns: 1fr; }
    .report-actions { flex-direction: column; }
}

/* ── Process Flow ── */
.process-flow {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 28px 0 16px;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 140px;
    opacity: 0.45;
    transition: opacity 0.2s;
}

.process-step.active { opacity: 1; }
.process-step.done { opacity: 0.7; }

/* Landing page flow — all steps visible */
.landing-flow .process-step { opacity: 0.8; }
.landing-flow .process-step.active { opacity: 1; }

.choose-label {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.process-step.active .step-number {
    background: var(--aws-orange);
    color: #fff;
}

.process-step.done .step-number {
    background: var(--success);
    color: #fff;
}

.step-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 150px;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin-top: 17px;
    flex-shrink: 0;
}

/* ── Pillar Tabs ── */
.pillar-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.pillar-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pillar-tab:hover { border-color: var(--aws-orange); color: var(--text-primary); }

.pillar-tab.active {
    background: var(--aws-dark);
    color: #fff;
    border-color: var(--aws-dark);
}

.pillar-tab.active .tab-count { color: var(--aws-orange); }

.tab-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── App Header ── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--aws-dark);
    display: flex;
    align-items: center;
    z-index: 100;
    padding: 0 24px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.header-brand:hover .header-title {
    opacity: 0.85;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--aws-orange);
    letter-spacing: 2px;
}

.header-subtitle {
    font-size: 13px;
    color: #aab7c4;
    font-weight: 400;
    border-left: 1px solid #4a5568;
    padding-left: 10px;
    margin-left: 2px;
}

/* ── Header Nav ── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: #cdd5de;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-caret {
    font-size: 10px;
    margin-left: 2px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 4px;
    z-index: 200;
}

.nav-dropdown-menu::before {
    content: "";
    display: block;
    height: 4px;
}

.nav-dropdown-menu-inner {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    min-width: 260px;
    padding: 6px 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.1s;
}

.nav-dropdown-menu a:hover {
    background: var(--aws-light);
    color: var(--aws-orange-hover);
}

/* ── How It Works Modal ── */
.modal-wide {
    max-width: 600px;
}

.how-steps {
    padding-left: 20px;
    margin: 12px 0;
}

.how-steps li {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 8px;
}

.how-steps li span {
    font-weight: 600;
    color: var(--aws-dark);
}

/* ── App Footer ── */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--aws-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.app-footer p {
    font-size: 11px;
    color: #8899a6;
    margin: 0;
}

/* Adjust screens for fixed header/footer */
.screen { padding-top: 88px; padding-bottom: 52px; }

/* ── Consent Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    font-size: 20px;
    color: var(--aws-dark);
    margin-bottom: 16px;
}

.consent-body p {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.consent-body ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.consent-body li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 6px;
}

.consent-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.org-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    margin: 12px 0 20px;
    transition: border-color 0.15s;
}
.org-input:focus {
    outline: none;
    border-color: var(--aws-orange);
}
