/* CSS Reset & System Settings */
:root {
    --bg-primary: #0a0e1a;
    --bg-gradient: linear-gradient(135deg, #0b1528 0%, #040814 100%);
    --card-bg: rgba(13, 27, 42, 0.75);
    --card-border: rgba(59, 130, 246, 0.15);
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --text-primary: #f3f4f6;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --transition-speed: 0.3s;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
    --radius-lg: 16px;
    --radius-md: 12px;
}

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

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow-x: hidden;
    padding: 40px 20px;
}

/* Glass background overlay */
.glass-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1100px;
    z-index: 1;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.header-icon {
    font-size: 1.8rem;
    color: var(--accent-blue);
    filter: drop-shadow(0 0 8px var(--accent-blue));
}

header h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    animation: fadeInUp 0.8s ease-out;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

/* Card Styles */
.form-card, .results-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
}

.form-card:hover, .results-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 12px 40px 0 rgba(59, 130, 246, 0.05);
}

/* Wizard Tabs */
.wizard-tabs {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background: rgba(10, 15, 30, 0.55);
    padding: 6px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.1));
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.step-num {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.75rem;
    color: inherit;
    transition: var(--transition-smooth);
}

.tab-btn.active .step-num {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Form Styles */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.step-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.step-title i {
    color: var(--accent-blue);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 576px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group.full-width {
    grid-column: span 2;
}

@media (max-width: 576px) {
    .input-group.full-width {
        grid-column: span 1;
    }
}

label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select, input[type="number"] {
    background: rgba(10, 15, 30, 0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

select:focus, input[type="number"]:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-help {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: -2px;
}

/* Rating selector (1-5 slider alternatives) */
.rating-group {
    display: flex;
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: 3px;
    justify-content: space-between;
}

.rating-group input[type="radio"] {
    display: none;
}

.rating-group label {
    flex: 1;
    text-align: center;
    padding: 7px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-smooth);
    margin: 0;
}

.rating-group input[type="radio"]:checked + label {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.rating-group.max-rating label {
    padding: 8px 4px;
    font-size: 0.75rem;
}

/* Button Styles */
.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.btn {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    border-color: var(--accent-blue);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0ea5e9 100%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    border-color: var(--success);
}

/* Placeholder and Initial State */
.initial-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    color: var(--text-secondary);
    padding: 20px;
}

.placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    color: rgba(59, 130, 246, 0.2);
}

.initial-message h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.initial-message p {
    font-size: 0.9rem;
    max-width: 320px;
    line-height: 1.5;
}

/* Prediction Results */
.prediction-results {
    animation: fadeIn 0.6s ease;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--accent-blue);
}

/* Outcome Box and Circular Progress */
.outcome-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .outcome-box {
        flex-direction: column;
        text-align: center;
    }
}

.circular-progress {
    position: relative;
    height: 90px;
    width: 90px;
    flex-shrink: 0;
    border-radius: 50%;
    background: conic-gradient(var(--accent-blue) 0deg, rgba(255, 255, 255, 0.05) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.circular-progress::before {
    content: "";
    position: absolute;
    height: 76px;
    width: 76px;
    border-radius: 50%;
    background-color: #0d1b2a;
}

.value-container {
    position: relative;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.outcome-text h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.outcome-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Detail Cards */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.detail-val {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

/* Alert Box */
.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-box i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.alert-box.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: rgba(16, 185, 129, 0.95);
}

.alert-box.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: rgba(245, 158, 11, 0.95);
}

.alert-box.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: rgba(239, 68, 68, 0.95);
}

.alert-title {
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
    font-family: var(--font-heading);
}

/* Factor Lists */
.factors-section h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.factors-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.factors-list li {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.factors-list.positive li i {
    color: var(--success);
}

.factors-list.negative li i {
    color: var(--danger);
}

/* Keyframes Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Footer & Copyright */
footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

footer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Header Top — Navigation Bar (matches reference app-nav) */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(13, 27, 42, 0.55);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 30px;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.about-btn, .portfolio-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 20px;
    margin: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 600px) {
    .header-top {
        flex-direction: column;
        gap: 12px;
        padding: 12px 18px;
    }
    .header-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Modal Window Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 100; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(6, 9, 18, 0.85); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    box-shadow: var(--shadow-premium);
    position: relative;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Style custom scrollbar inside modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.close-btn {
    position: absolute;
    top: 18px;
    right: 22px;
    color: var(--text-secondary);
    font-size: 1.8rem;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.modal-title i {
    color: var(--accent-blue);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.modal-section h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.modal-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 5px;
}

.modal-section ul li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
    line-height: 1.5;
}

.modal-section ul li::before {
    content: "•";
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    left: 4px;
    top: -2px;
}

.modal-section.highlight {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 18px;
    border-radius: var(--radius-md);
}

/* ===================================================================
   UNIVERSAL RESPONSIVE DESIGN
   Covers: Laptop, Tablet, iPhone, Android — all orientations
   =================================================================== */

/* iOS / Safari specific fixes */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Safe-area insets for notched devices (iPhone X+, modern Android) */
body {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-top: max(20px, env(safe-area-inset-top));
}

/* Remove iOS default tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Ensure form elements inherit font on mobile (iOS override) */
select, input, button, textarea {
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
}

/* Touch-friendly minimum tap targets */
.tab-btn, .btn, select, input[type="number"],
.rating-group label, .about-btn, .portfolio-btn {
    min-height: 44px; /* Apple & Google recommended touch target */
}

/* ========================
   TABLET LANDSCAPE (1024px)
   ======================== */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }

    .dashboard {
        gap: 20px;
    }

    .form-card, .results-card {
        padding: 24px;
    }

    header h1 {
        font-size: 1.9rem;
    }
}



/* ========================
   SMALL TABLET / LARGE PHONE (768px)
   ======================== */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

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

    header h1 {
        font-size: 1.8rem;
    }

    .header-icon {
        font-size: 1.5rem;
    }

    .header-top {
        padding: 12px 18px;
    }

    .tab-btn {
        font-size: 0.8rem;
        padding: 9px 6px;
    }

    .step-title {
        font-size: 1.1rem;
    }

    .form-card, .results-card {
        padding: 20px;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .detail-val {
        font-size: 1.15rem;
    }

    .about-btn, .portfolio-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    footer {
        margin-top: 30px;
    }
}

/* ========================
   PHONE (576px)
   ======================== */
@media (max-width: 576px) {
    body {
        padding: 15px 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    header {
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .header-icon {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.88rem;
    }

    .tab-btn {
        font-size: 0.75rem;
        padding: 9px 5px;
        gap: 5px;
    }

    .wizard-tabs {
        margin-bottom: 18px;
    }

    .step-title {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .form-card, .results-card {
        padding: 16px;
    }

    .form-grid {
        gap: 12px;
    }

    label {
        font-size: 0.75rem;
    }

    select, input[type="number"] {
        padding: 10px 12px;
        font-size: 16px; /* Prevents iOS auto-zoom */
    }

    .input-help {
        font-size: 0.68rem;
    }

    .rating-group label {
        padding: 7px 5px;
        font-size: 0.78rem;
    }

    .rating-group.max-rating label {
        padding: 7px 3px;
        font-size: 0.68rem;
    }

    .wizard-actions {
        margin-top: 20px;
        padding-top: 14px;
        gap: 8px;
    }

    .btn {
        padding: 9px 16px;
        font-size: 0.85rem;
    }

    /* Results card adjustments */
    .initial-message h2 {
        font-size: 1.15rem;
    }

    .initial-message p {
        font-size: 0.85rem;
    }

    .placeholder-icon {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 1.05rem;
        margin-bottom: 16px;
    }

    .outcome-box {
        gap: 14px;
        padding: 14px;
    }

    .circular-progress {
        width: 80px;
        height: 80px;
    }

    .circular-progress::before {
        width: 66px;
        height: 66px;
    }

    .value-container {
        font-size: 1.2rem;
    }

    .outcome-text h3 {
        font-size: 0.95rem;
    }

    .outcome-text p {
        font-size: 0.8rem;
    }

    .detail-card {
        padding: 12px;
    }

    .detail-label {
        font-size: 0.7rem;
    }

    .detail-val {
        font-size: 1.1rem;
    }

    .alert-box {
        padding: 12px;
        font-size: 0.8rem;
        gap: 10px;
    }

    .factors-list li {
        padding: 7px 10px;
        font-size: 0.8rem;
        gap: 8px;
    }

    /* Modal mobile */
    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 18px;
        max-height: 85vh;
    }

    .modal-title {
        font-size: 1.15rem;
        margin-bottom: 16px;
    }

    .close-btn {
        top: 12px;
        right: 16px;
        font-size: 1.5rem;
    }

    .modal-section h3 {
        font-size: 0.88rem;
    }

    .modal-section p {
        font-size: 0.83rem;
    }

    .modal-section ul li {
        font-size: 0.83rem;
    }

    .modal-section.highlight {
        padding: 14px;
    }

    footer p {
        font-size: 0.78rem;
    }
}

/* ========================
   SMALL PHONE (420px) — iPhone SE, Galaxy S small
   ======================== */
@media (max-width: 420px) {
    body {
        padding: 10px 8px;
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }

    header h1 {
        font-size: 1.2rem;
    }

    .header-icon {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.78rem;
    }

    .about-btn, .portfolio-btn {
        padding: 7px 10px;
        font-size: 0.75rem;
        gap: 5px;
    }

    /* Hide tab text labels, keep only step numbers */
    .tab-btn {
        font-size: 0;
        padding: 9px;
    }

    .step-num {
        font-size: 0.75rem;
    }

    .form-card, .results-card {
        padding: 12px;
    }

    .step-title {
        font-size: 0.9rem;
    }

    .form-grid {
        gap: 10px;
    }

    .rating-group label {
        padding: 6px 3px;
        font-size: 0.72rem;
    }

    .rating-group.max-rating label {
        font-size: 0.6rem;
        padding: 6px 2px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .outcome-box {
        flex-direction: column;
        text-align: center;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .modal-content {
        padding: 14px;
    }

    .modal-title {
        font-size: 1.05rem;
    }
}

/* ========================
   VERY SMALL PHONE (360px) — iPhone SE 1st gen
   ======================== */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.1rem;
    }

    .logo {
        gap: 6px;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .about-btn, .portfolio-btn {
        font-size: 0.7rem;
        padding: 7px 8px;
    }

    .form-card, .results-card {
        padding: 12px;
    }

    .wizard-tabs {
        padding: 4px;
        gap: 4px;
    }

    select, input[type="number"] {
        padding: 10px 12px;
    }

    .outcome-text h3 {
        font-size: 0.95rem;
    }

    .outcome-text p {
        font-size: 0.78rem;
    }

    .circular-progress {
        width: 75px;
        height: 75px;
    }

    .circular-progress::before {
        width: 62px;
        height: 62px;
    }

    .value-container {
        font-size: 1.15rem;
    }
}

/* ========================
   LANDSCAPE ORIENTATION on phones
   ======================== */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: flex-start;
    }

    .dashboard {
        grid-template-columns: 1fr 1fr;
        min-height: auto;
    }

    .initial-message {
        min-height: 200px;
    }

    header {
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .form-card, .results-card {
        padding: 16px;
    }

    .modal-content {
        max-height: 90vh;
    }
}

/* ========================
   LARGE DESKTOP / HIGH-RES (1440px+)
   ======================== */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }

    .dashboard {
        gap: 35px;
    }

    header h1 {
        font-size: 2.5rem;
    }
}

/* ========================
   ACCESSIBILITY: Reduced Motion
   ======================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================
   PRINT STYLES
   ======================== */
@media print {
    body {
        background: #fff;
        color: #000;
        padding: 0;
    }

    .glass-bg, .modal, .header-actions, .wizard-actions {
        display: none !important;
    }

    .form-card, .results-card {
        background: #fff;
        border: 1px solid #ddd;
        box-shadow: none;
        backdrop-filter: none;
    }
}

