/* ==========================================================================
   MW16 PLANERARE - 16-veckorsplanerare för muscles.se
   v1.0.0
   
   Design: Iron Chrome-tema (matchar sajten)
   Mobil: Kort-baserad layout, alltid stack på små skärmar
   ========================================================================== */

.mw16-root {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #151922;
    max-width: 100%;
    margin: 24px 0;
    line-height: 1.6;
}

.mw16-root *,
.mw16-root *::before,
.mw16-root *::after {
    box-sizing: border-box;
    min-width: 0;
}

/* ============ HERO ============ */
.mw16-hero {
    margin-bottom: 28px;
    text-align: left;
}

.mw16-eyebrow {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1e3a5f;
    background: rgba(212, 225, 87, 0.15);
    padding: 4px 10px;
    margin-bottom: 12px;
    border-radius: 2px;
}

.mw16-title {
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 36px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: #151922;
    margin: 0 0 12px;
    padding: 0;
    border: none;
}

.mw16-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: #d4e157;
    margin-top: 10px;
}

.mw16-lead {
    font-size: 17px;
    line-height: 1.6;
    color: #242936;
    margin: 0;
}

/* ============ CARDS ============ */
.mw16-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: 4px solid #1e3a5f;
    border-radius: 4px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(21, 25, 34, 0.04);
}

.mw16-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.mw16-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #1e3a5f;
    color: #ffffff;
    border-radius: 50%;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.mw16-card-title {
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
    text-transform: none;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* ============ FORM ============ */
.mw16-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.mw16-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.mw16-field-full {
    grid-column: 1 / -1;
}

.mw16-field label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}

.mw16-field input[type="number"],
.mw16-field select {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 16px;
    color: #151922;
    background: #f7f6f2;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.mw16-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231e3a5f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 40px;
}

.mw16-field input:focus,
.mw16-field select:focus {
    outline: none;
    border-color: #1e3a5f;
    background: #ffffff;
}

.mw16-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* ============ ACTIONS ============ */
.mw16-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.mw16-btn-primary,
.mw16-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.mw16-btn-primary {
    background: #1e3a5f;
    color: #ffffff;
}

.mw16-btn-primary:hover {
    background: #142841;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(21, 25, 34, 0.12);
}

.mw16-btn-secondary {
    background: #f7f6f2;
    color: #1e3a5f;
    border: 1px solid #e5e7eb;
}

.mw16-btn-secondary:hover {
    background: #e5e7eb;
}

/* ============ RESULTS ============ */
.mw16-results {
    margin-top: 32px;
    animation: mw16-fadein 0.4s ease;
}

@keyframes mw16-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mw16-summary-card {
    border-top-color: #d4e157;
}

.mw16-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0 24px;
}

.mw16-stat {
    background: #f7f6f2;
    border-left: 4px solid #1e3a5f;
    padding: 16px 18px;
    border-radius: 0 4px 4px 0;
}

.mw16-stat:nth-child(2) {
    border-left-color: #d4e157;
}

.mw16-stat:nth-child(3) {
    border-left-color: #e76f51;
}

.mw16-stat:nth-child(4) {
    border-left-color: #aeb930;
}

.mw16-stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}

.mw16-stat-value {
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #1e3a5f;
    line-height: 1.1;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.mw16-stat-sub {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* ============ MACRO SPLIT ============ */
.mw16-macro-split {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.mw16-macro-title {
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #151922;
    margin: 0 0 14px;
    line-height: 1.2;
}

.mw16-macro-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mw16-macro-row {
    display: grid;
    grid-template-columns: 100px 1fr 80px;
    align-items: center;
    gap: 12px;
}

.mw16-macro-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
}

.mw16-macro-bar {
    background: #f7f6f2;
    height: 24px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.mw16-macro-fill {
    height: 100%;
    transition: width 0.6s ease;
    border-radius: 2px 0 0 2px;
}

.mw16-fill-protein { background: #1e3a5f; }
.mw16-fill-carbs { background: #d4e157; }
.mw16-fill-fat { background: #e76f51; }

.mw16-macro-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #151922;
    text-align: right;
}

/* ============ FASTING VISUALIZATION ============ */
.mw16-fasting-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.mw16-fasting-vis {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 2px;
    margin: 14px 0;
    background: #f7f6f2;
    padding: 8px;
    border-radius: 4px;
}

.mw16-hour {
    height: 28px;
    background: #e5e7eb;
    border-radius: 2px;
    position: relative;
}

.mw16-hour-active {
    background: #d4e157;
}

.mw16-hour-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #6b7280;
    text-align: center;
    margin-top: 2px;
}

.mw16-fasting-text {
    margin: 12px 0 0;
    font-size: 14px;
    color: #242936;
    line-height: 1.5;
}

/* ============ PHASES ============ */
.mw16-phase-intro {
    margin: 0 0 18px;
    font-size: 15px;
    color: #242936;
    line-height: 1.6;
}

.mw16-phases {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mw16-phase {
    background: #f7f6f2;
    border-left: 4px solid #1e3a5f;
    border-radius: 0 4px 4px 0;
    padding: 16px 18px;
}

.mw16-phase-2 { border-left-color: #d4e157; }
.mw16-phase-3 { border-left-color: #e76f51; }
.mw16-phase-4 { border-left-color: #aeb930; }

.mw16-phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.mw16-phase-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffffff;
    background: #1e3a5f;
    padding: 3px 10px;
    border-radius: 2px;
}

.mw16-phase-weeks {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
}

.mw16-phase-title {
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 8px;
    line-height: 1.15;
}

.mw16-phase-desc {
    font-size: 14px;
    color: #242936;
    margin: 0 0 12px;
    line-height: 1.5;
}

.mw16-phase-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.mw16-phase-list li {
    padding: 4px 0;
    border-top: 1px solid rgba(30, 58, 95, 0.1);
    color: #242936;
}

.mw16-phase-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.mw16-phase-list strong {
    color: #1e3a5f;
    font-weight: 700;
    margin-right: 4px;
}

/* ============ MEALS ============ */
.mw16-card-meals {
    border-top-color: #e76f51;
}

.mw16-meals-intro {
    margin: 0 0 18px;
    font-size: 15px;
    color: #242936;
}

.mw16-meals {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mw16-meal {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    background: #f7f6f2;
    border-radius: 4px;
    border-left: 3px solid #d4e157;
}

.mw16-meal-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a5f;
}

.mw16-meal-name {
    font-size: 14px;
    color: #242936;
    line-height: 1.4;
}

.mw16-meal-macros {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #6b7280;
    text-align: right;
    line-height: 1.4;
    white-space: nowrap;
}

/* ============ WARNING ============ */
.mw16-warning {
    background: rgba(231, 111, 81, 0.08);
    border-left: 4px solid #e76f51;
    padding: 18px 22px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.mw16-warning-head {
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mw16-warning ul {
    margin: 0;
    padding-left: 20px;
}

.mw16-warning li {
    font-size: 14px;
    line-height: 1.6;
    color: #242936;
    margin-bottom: 6px;
}

/* ============ HELP / FAQ ============ */
.mw16-help {
    margin-top: 32px;
}

.mw16-help-details {
    background: rgba(30, 58, 95, 0.04);
    border: 1px solid rgba(30, 58, 95, 0.15);
    border-left: 4px solid #1e3a5f;
    border-radius: 0 4px 4px 0;
    padding: 0;
    overflow: hidden;
}

.mw16-help-details summary {
    cursor: pointer;
    padding: 16px 22px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e3a5f;
    list-style: none;
    position: relative;
    user-select: none;
}

.mw16-help-details summary::-webkit-details-marker {
    display: none;
}

.mw16-help-details summary::after {
    content: "+";
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 400;
    color: #1e3a5f;
}

.mw16-help-details[open] summary::after {
    content: "−";
}

.mw16-help-content {
    padding: 0 22px 20px;
}

.mw16-help-content h4 {
    font-family: 'Barlow Condensed', 'Impact', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 16px 0 8px;
    line-height: 1.2;
}

.mw16-help-content h4:first-child {
    margin-top: 0;
}

.mw16-help-content p {
    font-size: 14px;
    color: #242936;
    line-height: 1.6;
    margin: 0 0 8px;
}

/* ============ PRINT ============ */
@media print {
    .mw16-form,
    .mw16-actions,
    .mw16-help,
    .mw16-hero {
        display: none;
    }
    
    .mw16-card {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .mw16-phases {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============ MOBIL ============ */
@media (max-width: 700px) {
    .mw16-title {
        font-size: 28px;
    }
    
    .mw16-lead {
        font-size: 16px;
    }
    
    .mw16-card {
        padding: 18px 18px;
    }
    
    .mw16-card-title {
        font-size: 22px;
    }
    
    .mw16-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mw16-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .mw16-stat {
        padding: 12px 14px;
    }
    
    .mw16-stat-value {
        font-size: 24px;
    }
    
    .mw16-macro-row {
        grid-template-columns: 80px 1fr 70px;
        gap: 8px;
    }
    
    .mw16-phases {
        grid-template-columns: 1fr;
    }
    
    .mw16-meal {
        grid-template-columns: 1fr;
        gap: 6px;
        text-align: left;
    }
    
    .mw16-meal-macros {
        text-align: left;
        white-space: normal;
    }
    
    .mw16-btn-primary,
    .mw16-btn-secondary {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .mw16-actions {
        flex-direction: column;
    }
    
    .mw16-fasting-vis {
        grid-template-columns: repeat(12, 1fr);
        gap: 3px;
    }
}

@media (max-width: 400px) {
    .mw16-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .mw16-stat-value {
        font-size: 28px;
    }
}
