/* === Design Tokens === */
:root {
    --navy: #0a192f;
    --navy-mid: #122744;
    --blue-deep: #1e3a8a;
    --blue-primary: #3b82f6;
    --cyan: #06b6d4;
    --cyan-soft: #22d3ee;
    --violet: #667eea;
    --emerald: #38a169;

    --bg-page: #f0f4f8;
    --bg-card: #ffffff;
    --bg-input: #f7f9fc;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #5f6d7e;
    --border: #e2e8f0;
    --border-light: #edf2f7;

    --accent: #0e7490;
    --accent-dark: #0c6478;
    --accent-light: rgba(14, 116, 144, 0.08);
    --accent-glow: rgba(14, 116, 144, 0.25);

    --gradient-brand: linear-gradient(135deg, var(--blue-primary), #06b6d4);
    --gradient-violet: linear-gradient(135deg, var(--violet), #764ba2);
    --gradient-header: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 40%, var(--blue-deep) 100%);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 8px 30px rgba(6, 182, 212, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

/* Subtle background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(6, 182, 212, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 90%, rgba(102, 126, 234, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* === Hero Header === */
.site-header {
    background: var(--gradient-header);
    padding: 3rem 2rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: headerPulse 6s ease-in-out infinite;
}

@keyframes headerPulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    margin: 0 auto;
}

.header-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan-soft);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 0.3rem 1rem;
    border-radius: 100px;
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    line-height: 1.1;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
    text-shadow: 0 2px 20px rgba(6, 182, 212, 0.3);
}

.logo-accent {
    background: linear-gradient(135deg, var(--cyan-soft), var(--blue-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.6rem;
    font-weight: 400;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
    letter-spacing: 0.01em;
}

.header-byline {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.75rem;
    animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.header-byline a {
    color: rgba(6, 182, 212, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.header-byline a:hover {
    color: var(--cyan-soft);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Container === */
.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    position: relative;
    z-index: 1;
}

/* === Form Card === */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

/* Gradient top accent bar */
.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand);
}

.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #fff;
}

::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.optional-label {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.45;
}

/* === Bloom's Taxonomy Tags === */
.blooms-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.blooms-create { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #166534; }
.blooms-evaluate { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #166534; }
.blooms-analyze { background: linear-gradient(135deg, #fef9c3, #fef08a); color: #854d0e; }
.blooms-apply { background: linear-gradient(135deg, #fef9c3, #fef08a); color: #854d0e; }
.blooms-understand { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }
.blooms-remember { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }

/* === Tier Toggle === */
.tier-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--border);
}

.tier-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-input);
    transition: all 0.2s;
    text-align: center;
    border-right: 1px solid var(--border);
    user-select: none;
}

.tier-option:last-child {
    border-right: none;
}

.tier-option:hover {
    background: #edf2f7;
}

.tier-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tier-option:has(input:checked) {
    background: rgba(14, 116, 144, 0.08);
    color: #0e7490;
    font-weight: 700;
    border-color: rgba(14, 116, 144, 0.3);
}

/* === Options Toggle === */
.options-toggle {
    margin-bottom: 1.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s;
}

.options-toggle:hover {
    border-color: #cbd5e1;
}

.options-toggle summary {
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: var(--bg-input);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.15s;
}

.options-toggle summary:hover {
    background: #edf2f7;
}

.options-toggle summary::before {
    content: '▸';
    font-size: 0.75rem;
    transition: transform 0.25s;
    color: var(--accent);
}

.options-toggle[open] summary::before {
    transform: rotate(90deg);
}

.options-toggle summary::-webkit-details-marker {
    display: none;
}

.options-content {
    padding: 1.15rem;
    border-top: 1px solid var(--border-light);
    background: #fafbfc;
}

.options-content .form-group:last-child {
    margin-bottom: 0;
}

/* === Checkboxes as Chips === */
.checkbox-section {
    margin-bottom: 1.75rem;
}

.select-all-label {
    padding-bottom: 0.7rem;
    margin-bottom: 0.7rem;
    border-bottom: 1.5px solid var(--border-light);
    font-weight: 700;
    font-size: 0.9rem;
}

.select-all-label span {
    font-weight: 700;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    background: var(--bg-input);
    transition: all 0.2s;
    font-weight: 500;
}

.checkbox-label:hover {
    background: #edf2f7;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

/* Checked chip state */
.checkbox-label:has(input:checked) {
    background: rgba(6, 182, 212, 0.06);
    border-color: rgba(14, 116, 144, 0.3);
    color: var(--accent-dark);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}

/* === Buttons === */
.btn-primary {
    display: block;
    width: 100%;
    padding: 0.9rem 1.75rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: var(--gradient-brand);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.25s, filter 0.2s;
    box-shadow: var(--shadow-glow);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(6, 182, 212, 0.35);
    filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

.btn-secondary {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(14, 116, 144, 0.06);
    border: 2px solid rgba(14, 116, 144, 0.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(14, 116, 144, 0.12);
    border-color: rgba(14, 116, 144, 0.4);
    transform: translateY(-1px);
}

/* === Progress Section === */
.progress-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.progress-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand);
}

.progress-header {
    margin-bottom: 1.5rem;
}

.progress-title {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.progress-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-counter {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    position: relative;
    padding-left: 2.5rem;
    transition: opacity 0.3s;
}

.progress-item.waiting {
    opacity: 0.45;
}

/* Connecting line */
.progress-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 2rem;
    width: 2px;
    height: calc(100% - 0.6rem);
    background: var(--border);
    transition: background 0.4s;
}

.progress-item.complete:not(:last-child)::before {
    background: var(--emerald);
}

.progress-item.generating:not(:last-child)::before {
    background: var(--accent);
}

/* Dot */
.progress-dot {
    position: absolute;
    left: 0.35rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    flex-shrink: 0;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.progress-item.waiting .progress-dot {
    background: #d1d5db;
}

.progress-item.generating .progress-dot {
    background: var(--gradient-brand);
    animation: pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 12px var(--accent-glow);
}

.progress-item.complete .progress-dot {
    background: var(--emerald);
    animation: checkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 0 8px rgba(56, 161, 105, 0.3);
}

.progress-dot .dot-icon {
    font-size: 0.6rem;
    line-height: 1;
    font-weight: 700;
}

.progress-label {
    font-size: 0.92rem;
    color: var(--text-muted);
    transition: color 0.3s, font-weight 0.3s;
    font-weight: 500;
}

.progress-item.generating .progress-label {
    color: var(--accent);
    font-weight: 600;
}

.progress-item.complete .progress-label {
    color: var(--emerald);
    font-weight: 600;
}

.progress-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
    transition: color 0.3s;
    font-weight: 500;
}

.progress-item.generating .progress-status {
    color: var(--accent);
    font-weight: 600;
}

.progress-item.complete .progress-status {
    color: var(--emerald);
    font-weight: 700;
}

/* Rotating messages */
.progress-messages {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
    min-height: 3rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.message-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    animation: wobble 2s ease-in-out infinite;
}

.message-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
    transition: opacity 0.3s;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(6, 182, 212, 0);
        transform: scale(1.1);
    }
}

@keyframes checkPop {
    0% { transform: scale(0.5); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall 2.5s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* Progress complete state */
.progress-card.all-done {
    border-color: rgba(56, 161, 105, 0.3);
    box-shadow: 0 4px 20px rgba(56, 161, 105, 0.12);
}

.progress-card.all-done::before {
    background: linear-gradient(135deg, var(--emerald), #48bb78);
}

/* === Result Cards === */
.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
    overflow: hidden;
    animation: slideIn 0.4s ease-out;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.result-card:hover::before {
    opacity: 1;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.card-header:hover {
    background: rgba(14, 116, 144, 0.02);
}

.card-title {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.btn-copy {
    padding: 0.3rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(14, 116, 144, 0.06);
    border: 1.5px solid rgba(14, 116, 144, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(14, 116, 144, 0.12);
    border-color: rgba(14, 116, 144, 0.35);
}

.card-body {
    padding: 0 1.5rem 1.5rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.card-body h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-light);
}

.card-body h3:first-child {
    margin-top: 0;
}

.card-body h4 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin: 1rem 0 0.35rem;
}

.card-body p {
    margin-bottom: 0.65rem;
}

.card-body ul, .card-body ol {
    margin: 0.5rem 0 0.85rem 1.5rem;
}

.card-body li {
    margin-bottom: 0.35rem;
}

.card-body strong {
    color: var(--text-primary);
    font-weight: 700;
}

.card-body.collapsed {
    display: none;
}

/* === Action Buttons === */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons .btn-primary {
    width: auto;
    display: inline-block;
    padding: 0.75rem 2rem;
}

/* === Error Card === */
.error-card {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.error-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.error-card p {
    color: #dc2626;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* === Suggestion Box === */
.suggestion-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem 2.25rem;
    border: 1px solid var(--border-light);
    margin-top: 2.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.suggestion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-violet);
    opacity: 0.6;
}

.suggestion-title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.suggestion-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
}

#suggestion-text {
    margin-bottom: 0.85rem;
}

.btn-suggestion {
    padding: 0.6rem 1.3rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--violet);
    background: rgba(102, 126, 234, 0.06);
    border: 1.5px solid rgba(102, 126, 234, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-suggestion:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.4);
}

.btn-suggestion:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.confirmation {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--emerald);
    font-weight: 600;
}

/* === Footer === */
.site-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* === Skip Link === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--navy);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* === 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: 0;
}

/* === Fieldset Reset === */
fieldset.checkbox-section {
    border: none;
    padding: 0;
    margin: 0 0 1.75rem;
}

/* === Focus Visible === */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* === Standards Autocomplete === */
.autocomplete-wrapper {
    position: relative;
}

.standard-match {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--emerald);
    font-weight: 700;
    font-size: 1.1rem;
    pointer-events: none;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
}

.autocomplete-item {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--accent-light);
}

.autocomplete-code {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--accent);
    display: block;
}

.autocomplete-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.15rem;
    line-height: 1.35;
}

/* === Tier Toggle === */
.tier-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--border);
}

.tier-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-input);
    transition: all 0.2s;
    text-align: center;
    border-right: 1px solid var(--border);
    user-select: none;
}

.tier-option:last-child {
    border-right: none;
}

.tier-option:hover {
    background: #edf2f7;
}

.tier-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tier-option:has(input:checked) {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    border-color: rgba(14, 116, 144, 0.3);
}

/* === Tier Badge on Result Cards === */
.tier-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.tier-badge-supported {
    background: rgba(102, 126, 234, 0.1);
    color: var(--violet);
}

.tier-badge-extension {
    background: rgba(56, 161, 105, 0.1);
    color: var(--emerald);
}

/* === Google Buttons === */
.google-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a73e8;
    background: rgba(26, 115, 232, 0.06);
    border: 1.5px solid rgba(26, 115, 232, 0.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google:hover {
    background: rgba(26, 115, 232, 0.12);
    border-color: rgba(26, 115, 232, 0.4);
    transform: translateY(-1px);
}

.google-icon {
    font-size: 1rem;
}

.google-auth-status {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.google-signin-link {
    color: #1a73e8;
    font-weight: 600;
    text-decoration: none;
}

.google-signin-link:hover {
    text-decoration: underline;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.modal-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.course-list {
    max-height: 250px;
    overflow-y: auto;
}

.course-item {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    font-size: 0.92rem;
}

.course-item:hover {
    border-color: #1a73e8;
    background: rgba(26, 115, 232, 0.04);
}

.modal-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* === Utility === */
.hidden {
    display: none !important;
}

/* === Responsive === */
@media (max-width: 640px) {
    .site-header {
        padding: 2rem 1.25rem 1.75rem;
    }

    .logo {
        font-size: 2.2rem;
    }

    .tagline {
        font-size: 0.92rem;
    }

    .container {
        padding: 1.25rem 1rem 2rem;
    }

    .form-card,
    .progress-card,
    .suggestion-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius-lg);
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn-primary,
    .action-buttons .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .card-body {
        padding: 0 1.15rem 1.15rem;
    }

    .card-header {
        padding: 1rem 1.15rem;
    }
}

/* === Print Stylesheet === */
@media print {
    body {
        background: #fff;
        font-size: 12pt;
    }

    body::before {
        display: none;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .site-header,
    #input-section,
    #progress-section,
    #suggestion-section,
    .site-footer,
    .action-buttons,
    .btn-copy,
    .card-header,
    #error-section {
        display: none !important;
    }

    .result-card {
        border: none;
        box-shadow: none;
        border-left: none;
        page-break-inside: avoid;
        margin-bottom: 0;
    }

    .result-card::before {
        display: none;
    }

    .card-body {
        padding: 0;
    }

    .card-body.collapsed {
        display: block !important;
    }
}

/* === Image Upload === */
.image-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--bg-input);
    position: relative;
}

.image-upload-zone:hover,
.image-upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-prompt p {
    margin: 0.2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.upload-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
}

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

#preview-filename {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-remove-image {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0;
    font-weight: 600;
    text-align: left;
    width: fit-content;
}

.btn-remove-image:hover {
    text-decoration: underline;
}

.analyzing-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

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

.upload-analyzing {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.upload-analysis {
    text-align: left;
}

.upload-analysis details summary {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--emerald);
    cursor: pointer;
}

.upload-analysis details p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.5;
    max-height: 150px;
    overflow-y: auto;
}
