/* ============================================
   IJOOZ Sales Forecast — Brand Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #F5A623;
    --primary-dark: #FF8C00;
    --primary-light: #FFF3E0;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --white: #FFFFFF;
    --bg: #FAFAFA;
    --border: #E0E0E0;
    --border-light: #F0F0F0;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 50px;
    --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Header --- */
.header {
    background: var(--white);
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 2px;
}

.logo:hover {
    color: var(--primary-dark);
}

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

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-link--logout {
    color: var(--text-muted);
}

.nav-lang-toggle {
    display: inline-flex;
    gap: 2px;
    margin-left: 8px;
    border-left: 1px solid #e0e0e0;
    padding-left: 8px;
}

.nav-link--lang {
    font-size: 0.75rem;
    padding: 4px 6px;
    border-radius: 4px;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-link--lang-active {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* --- Main --- */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    width: 100%;
}

/* --- Footer --- */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 8px;
}
.footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 0.8rem;
}
.footer-links a:hover { color: var(--primary); }

/* --- Flash Messages --- */
.flash-container {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    animation: slideDown 0.3s ease;
}

.flash--success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid var(--success); }
.flash--error { background: #FFEBEE; color: #C62828; border-left: 4px solid var(--danger); }
.flash--warning { background: #FFF3E0; color: #E65100; border-left: 4px solid var(--warning); }
.flash--info { background: #E3F2FD; color: #1565C0; border-left: 4px solid var(--info); }

.flash-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 4px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn--primary {
    background: var(--primary);
    color: var(--white);
}

.btn--primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background: var(--text);
    color: var(--white);
}

.btn--secondary:hover {
    background: #555;
    color: var(--white);
}

.btn--outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn--outline:hover {
    background: var(--primary-light);
}

.btn--full {
    width: 100%;
}

.btn--large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn--small {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-unit {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: auto;
}

.required {
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group--half {
    flex: 1;
    min-width: 0;
}

.form-group--third {
    flex: 1;
    min-width: 0;
}

/* --- Form Sections --- */
.form-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--primary-light);
    border-bottom: 1px solid var(--border-light);
}

.section-header--collapsible {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.section-header--collapsible:hover {
    background: #FFE8C0;
}

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

.section-title {
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
}

.section-toggle {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.section-toggle--open {
    transform: rotate(180deg);
}

.section-body {
    padding: 20px;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
}

.section-body--collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
}

.section-body--expanded {
    max-height: 2000px;
    opacity: 1;
}

/* --- Radio Cards --- */
.radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-group--vertical {
    flex-direction: column;
}

.radio-card {
    flex: 1;
    min-width: 100px;
    cursor: pointer;
}

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

.radio-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: all var(--transition);
    text-align: center;
}

.radio-card input:checked + .radio-card-body {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.radio-card:hover .radio-card-body {
    border-color: var(--primary);
}

.radio-card-icon {
    font-size: 1.5rem;
}

.radio-card-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.radio-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.radio-card--horizontal .radio-card-body {
    flex-direction: row;
    text-align: left;
    padding: 12px 16px;
}

.radio-card--horizontal .radio-card-content {
    display: flex;
    flex-direction: column;
}

.coefficient {
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-weight: 700;
}

/* --- Range Slider --- */
.range-wrapper {
    position: relative;
    padding: 10px 0;
}

.form-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--border), var(--primary));
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform var(--transition);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.form-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.range-value {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    margin-top: 8px;
}

/* --- Checkbox Cards --- */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-card {
    cursor: pointer;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: all var(--transition);
    text-align: center;
}

.checkbox-card input:checked + .checkbox-card-body {
    border-color: var(--primary);
    background: var(--primary-light);
}

.checkbox-card:hover .checkbox-card-body {
    border-color: var(--primary);
}

.checkbox-card-icon {
    font-size: 1.4rem;
}

.checkbox-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.checkbox-card-points {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: rgba(245, 166, 35, 0.12);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.checkbox-card-points--positive {
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.checkbox-card-points--negative {
    color: var(--danger);
    background: rgba(244, 67, 54, 0.1);
}

.checkbox-card--positive input:checked + .checkbox-card-body {
    border-color: var(--success);
    background: #E8F5E9;
}

.checkbox-card--negative input:checked + .checkbox-card-body {
    border-color: var(--danger);
    background: #FFEBEE;
}

/* --- Help Tooltip Icon --- */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
    line-height: 1;
    user-select: none;
}

.help-icon:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* --- Tooltip Popup --- */
.tooltip-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    background: var(--white);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 14px 32px 14px 14px;
    margin-top: 6px;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.6;
    max-width: 360px;
    min-width: 240px;
    box-shadow: var(--shadow-lg);
    animation: tooltipFadeIn 0.15s ease;
}

.tooltip-close {
    position: absolute;
    top: 6px;
    right: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1;
}

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

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

/* --- Form Submit --- */
.form-submit {
    margin-top: 12px;
    padding: 0 0 20px;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.login-mascot {
    margin-bottom: 12px;
}

.juju-login {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}
.juju-advice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
}
.juju-advice-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}
.juju-bubble {
    background: #FFF3E0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #555;
}
.juju-bubble p { margin: 0; }

.login-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 24px;
}

.login-error {
    background: #FFEBEE;
    color: #C62828;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    border-left: 4px solid var(--danger);
    text-align: left;
}

.login-form .form-group {
    text-align: left;
}

/* ============================================
   Result Page
   ============================================ */
.result-header-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 32px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.result-location {
    font-size: 1.4rem;
    font-weight: 900;
}

.result-address {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 4px;
}

.result-date {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 8px;
}

/* --- Score Cards --- */
.score-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.score-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary);
}

.score-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.score-card-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}

.score-card-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Score color coding */
.score-color[data-score] { color: var(--danger); }
.score-color.score--green { color: var(--success); }
.score-color.score--yellow { color: var(--warning); }
.score-color.score--orange { color: var(--primary-dark); }
.score-color.score--red { color: var(--danger); }

/* --- Recommendation Banners --- */
.recommendation-banner {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1rem;
}

.recommendation--green {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.recommendation--blue {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

.recommendation--yellow {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFCC80;
}

.recommendation--red {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* --- Result Section --- */
.result-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

/* --- Data Table --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    background: var(--primary-light);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

.data-table--hover tbody tr {
    cursor: pointer;
    transition: background var(--transition);
}

.data-table--hover tbody tr:hover {
    background: var(--primary-light);
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }
.text-muted { color: var(--text-muted); }

/* --- Contribution Bar --- */
.contribution-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contribution-fill {
    height: 6px;
    background: var(--primary);
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.5s ease;
}

.contribution-value {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Badge --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* --- Score Badge (History) --- */
.score-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
}

.score-badge--green { background: var(--success); }
.score-badge--yellow { background: var(--warning); }
.score-badge--orange { background: var(--primary-dark); }
.score-badge--red { background: var(--danger); }

/* --- Recommendation Tag (History) --- */
.rec-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.rec-tag--green { background: #E8F5E9; color: #2E7D32; }
.rec-tag--blue { background: #E3F2FD; color: #1565C0; }
.rec-tag--yellow { background: #FFF3E0; color: #E65100; }
.rec-tag--red { background: #FFEBEE; color: #C62828; }

/* --- Advice Block --- */
.advice-block {
    padding: 4px 0;
}

.advice-list {
    list-style: none;
    padding: 0;
}

.advice-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--border-light);
}

.advice-list li:last-child {
    border-bottom: none;
}

.advice-list li::before {
    content: "\1F34A";
    position: absolute;
    left: 0;
    top: 8px;
}

/* --- Result Actions --- */
.result-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}

/* --- Juju Speech Bubble (Result) --- */
.juju-speech {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin: 32px 0 16px;
    justify-content: flex-end;
}

.juju-bubble {
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-bottom-right-radius: 4px;
    padding: 14px 18px;
    max-width: 360px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.juju-speech-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

/* --- Juju Floating Mascot (Predict) --- */
.juju-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 40;
    opacity: 0.8;
    pointer-events: none;
}

.juju-float-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

/* --- Empty State (History) --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.score-animate {
    animation: countUp 0.6s ease forwards;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 12px 20px;
        border-bottom: 2px solid var(--primary);
        box-shadow: var(--shadow-md);
    }

    .nav.nav--open {
        display: flex;
    }

    .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-toggle {
        display: flex;
    }

    .score-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .score-card-value {
        font-size: 1.8rem;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-card {
        min-width: 0;
    }

    .radio-card-body {
        flex-direction: row;
        padding: 12px;
    }

    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .juju-speech {
        flex-direction: column-reverse;
        align-items: center;
    }

    .juju-float {
        bottom: 12px;
        right: 12px;
    }

    .juju-float-img {
        width: 56px;
        height: 56px;
    }

    .tooltip-popup {
        max-width: 280px;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        height: 52px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .main {
        padding: 16px 12px 32px;
    }

    .section-body {
        padding: 16px 12px;
    }

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

    .login-card {
        padding: 28px 20px;
    }

    .result-header-card {
        padding: 24px 20px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .footer,
    .nav-toggle,
    .juju-float,
    .result-actions,
    .help-icon,
    .tooltip-popup,
    .flash-container {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 11pt;
    }

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

    .result-header-card {
        background: #F5A623 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .score-card {
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .recommendation-banner {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .form-section,
    .result-section {
        break-inside: avoid;
    }

    .section-body--collapsed {
        max-height: none;
        opacity: 1;
    }

    .data-table {
        font-size: 9pt;
    }

    .juju-speech-img {
        width: 48px;
        height: 48px;
    }
}

.login-hint {
    margin-top: 16px;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    line-height: 1.6;
}

.forgot-password-link {
    color: var(--primary-dark);
    font-weight: 500;
    text-decoration: underline;
    font-size: 0.85rem;
}

.forgot-password-link:hover {
    color: var(--primary);
}

/* --- Reset Token Display --- */
.reset-token-box {
    background: #F5F5F5;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.8rem;
    margin: 12px 0;
    text-align: left;
}

.reset-success {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    border-left: 4px solid var(--success);
    text-align: left;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.loading-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}
.loading-card {
    text-align: center;
    max-width: 400px;
    padding: 40px 32px;
}
.loading-juju {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    animation: loading-bounce 1.2s ease-in-out infinite;
}
.loading-juju-svg {
    width: 100%;
    height: 100%;
}
.loading-sweat {
    animation: sweat-drip 1.5s ease-in-out infinite;
}
@keyframes sweat-drip {
    0%, 100% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    70% { opacity: 1; transform: translateY(8px); }
    100% { opacity: 0; transform: translateY(12px); }
}
@keyframes loading-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.loading-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary, #F5A623);
    margin: 0 0 4px;
}
.loading-subtitle {
    font-size: 0.9rem;
    color: #999;
    margin: 0 0 24px;
}
.loading-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.loading-bar {
    flex: 1;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}
.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #F5A623, #FF8C00);
    border-radius: 6px;
    transition: width 0.3s ease;
}
.loading-percent {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary, #F5A623);
    min-width: 40px;
}
.loading-steps {
    text-align: left;
}
.loading-step {
    font-size: 0.85rem;
    color: #ccc;
    padding: 4px 0;
    transition: color 0.3s, opacity 0.3s;
}
.loading-step--active {
    color: #333;
}
.loading-step--done {
    color: #4CAF50;
}
.loading-step--done::after {
    content: " ✓";
    color: #4CAF50;
}

/* ===== Feedback/Error Report ===== */
.feedback-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}
.feedback-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 32px;
}
.feedback-card .form-group {
    margin-bottom: 20px;
}
.feedback-type-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.feedback-type-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.feedback-type-btn:has(input:checked) {
    border-color: var(--primary, #F5A623);
    background: #FFF3E0;
    color: var(--primary, #F5A623);
}
.feedback-type-btn input {
    display: none;
}
.feedback-success {
    text-align: center;
    padding: 40px;
}
.feedback-success-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
