/* ============================================
   Kalkulator PHK - Simplified
   ============================================ */

:root {
    --charcoal: #1a1a2e;
    --charcoal-light: #2d2d44;
    --coral: #e85d4e;
    --coral-light: #f5e6e4;
    --cream: #faf9f7;
    --white: #ffffff;
    --gray-100: #f5f5f3;
    --gray-200: #e8e8e6;
    --gray-300: #d4d4d2;
    --gray-400: #9a9a98;
    --gray-500: #6b6b69;
    --text: #1a1a2e;
    --text-secondary: #4a4a48;
    --text-muted: #6b6b69;
    --border: #e8e8e6;
    --border-focus: #1a1a2e;
    --radius: 4px;
    --radius-lg: 8px;
    --shadow: 0 1px 2px rgba(26,26,46,0.04);
    --shadow-md: 0 4px 12px rgba(26,26,46,0.08);
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 680px; margin: 0 auto; padding: 0 24px; }

/* Header */
.header {
    padding: 48px 0 32px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.subtitle .highlight { color: var(--coral); font-weight: 600; }

/* Section Blocks */
.section-block { margin-bottom: 40px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--charcoal);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius);
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: -0.01em;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

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

label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.required { color: var(--coral); font-weight: 600; }

input, select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input:focus, select:focus {
    border-color: var(--border-focus);
    background: var(--white);
}

input::placeholder { color: var(--gray-400); }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239a9a98' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* Input Pair */
.input-pair {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-pair input {
    flex: 1;
    text-align: center;
    background-image: none;
    padding-right: 12px;
}

.unit {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* Currency Input */
.input-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency {
    position: absolute;
    left: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}

.input-currency input {
    padding-left: 38px;
    background-image: none;
    padding-right: 12px;
}

/* Info Panel */
.info-panel {
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--coral-light);
    border-left: 3px solid var(--coral);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.info-panel p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 6px;
}

.info-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--coral);
    background: var(--white);
    padding: 3px 10px;
    border-radius: var(--radius);
}

/* Buttons */
.actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-primary, .btn-text {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.btn-primary {
    background: var(--charcoal);
    color: var(--white);
    padding: 12px 28px;
    letter-spacing: 0.01em;
}

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

.btn-text {
    background: transparent;
    color: var(--text-muted);
    padding: 12px 16px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

/* Result Section */
.result-section {
    animation: fadeIn 0.3s ease;
}

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

.result-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.result-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: -0.02em;
}

.result-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Summary Card */
.summary-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.summary-card h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 24px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    padding: 4px 0;
}

.summary-label { color: var(--text-muted); font-weight: 400; }
.summary-value { color: var(--text); font-weight: 600; text-align: right; }

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.result-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.result-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border);
}

.result-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--charcoal);
}

.result-icon { color: var(--coral); font-size: 10px; }

.result-item-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--charcoal);
    font-family: 'SF Mono', 'Monaco', monospace;
    letter-spacing: -0.01em;
}

.result-item-body {
    padding: 14px 18px;
}

.result-item-body p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Excluded */
.result-item.excluded .result-item-header {
    background: var(--coral-light);
    border-bottom-color: var(--coral);
}

.result-item.excluded .result-item-title { color: var(--coral); }

#notEligibleList { list-style: none; padding: 0; }

#notEligibleList li {
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

#notEligibleList li:last-child { border-bottom: none; }

#notEligibleList li strong {
    color: var(--coral);
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

#notEligibleList li small {
    color: var(--text-muted);
    font-size: 11px;
}

/* UPH Breakdown */
.uph-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

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

.uph-breakdown-label { color: var(--text-secondary); }

.uph-breakdown-value {
    font-weight: 600;
    color: var(--text);
    font-family: 'SF Mono', 'Monaco', monospace;
}

/* Total Box */
.total-box {
    background: var(--charcoal);
    color: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    text-align: center;
}

.total-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 6px;
}

.total-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', monospace;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.total-words {
    font-size: 12px;
    opacity: 0.6;
    font-style: italic;
}

/* Result Actions */
.result-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

/* Lampiran Section */
.lampiran-section {
    margin-top: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    page-break-before: always;
    break-before: page;
}

.lampiran-header {
    background: var(--charcoal);
    color: var(--white);
    padding: 16px 20px;
    text-align: center;
}

.lampiran-header h3 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.lampiran-header p {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 400;
}

.lampiran-content {
    padding: 0;
    background: var(--white);
}

.lampiran-pasal {
    border-bottom: 1px solid var(--border);
    page-break-inside: avoid;
    break-inside: avoid;
}

.lampiran-pasal:last-child { border-bottom: none; }

.lampiran-pasal-title {
    background: var(--gray-100);
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--charcoal);
    border-left: 3px solid var(--coral);
}

.lampiran-pasal-content {
    padding: 12px 16px;
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-line;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0 48px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.footer p:first-child {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 14mm 10mm 14mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body {
        background: white !important;
        font-size: 8.5pt !important;
        line-height: 1.3 !important;
        color: #1a1a2e !important;
        margin: 0 !important;
        padding: 0 !important;
    }

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

    .header,
    .form-section,
    .actions,
    .result-actions,
    .footer {
        display: none !important;
    }

    .result-section {
        display: block !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .result-section::before {
        content: "SURAT PERHITUNGAN HAK KARYAWAN";
        display: block;
        text-align: center;
        font-size: 13pt;
        font-weight: 700;
        color: #1a1a2e;
        padding-bottom: 3px;
        margin-bottom: 8px;
        border-bottom: 2px solid #1a1a2e;
        letter-spacing: 0.5px;
    }

    .summary-card {
        background: white !important;
        border: 1px solid #333 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin-bottom: 8px !important;
    }

    .summary-card h4 {
        background: #1a1a2e !important;
        color: white !important;
        padding: 4px 10px !important;
        margin: 0 !important;
        font-size: 8pt !important;
        font-weight: 600;
        border-bottom: 1px solid #333;
        border-radius: 0 !important;
    }

    .summary-grid {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .summary-item {
        display: table-row !important;
        border-bottom: 1px solid #ddd !important;
    }

    .summary-item:last-child { border-bottom: none !important; }

    .summary-label,
    .summary-value {
        display: table-cell !important;
        padding: 3px 10px !important;
        font-size: 8.5pt !important;
        border-bottom: 1px solid #eee !important;
    }

    .summary-label {
        width: 32% !important;
        color: #555 !important;
        font-weight: 500;
        background: #f5f5f3 !important;
    }

    .summary-value {
        width: 68% !important;
        color: #1a1a2e !important;
        font-weight: 600;
    }

    .results-list {
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    .result-item {
        background: white !important;
        border: 1px solid #333 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 4px !important;
    }

    .result-item-header {
        background: #f5f5f3 !important;
        border-bottom: 1.5px solid #1a1a2e !important;
        padding: 4px 10px !important;
    }

    .result-item-title {
        font-size: 9pt !important;
        font-weight: 700;
        color: #1a1a2e !important;
        gap: 6px !important;
    }

    .result-icon { color: #e85d4e !important; font-size: 8px !important; }

    .result-item-value {
        font-size: 10pt !important;
        font-weight: 700;
        color: #1a1a2e !important;
    }

    .result-item-body {
        padding: 5px 10px !important;
    }

    .result-item-body p {
        font-size: 8pt !important;
        color: #333 !important;
        margin-bottom: 3px !important;
        line-height: 1.25 !important;
    }

    .result-item.excluded .result-item-header {
        background: #f5e6e4 !important;
        border-bottom-color: #e85d4e !important;
    }

    .result-item.excluded .result-item-title { color: #e85d4e !important; }

    #notEligibleList li {
        font-size: 8pt !important;
        padding: 2px 0 !important;
    }

    .uph-breakdown-item {
        font-size: 8pt !important;
        padding: 2px 0 !important;
    }

    .total-box {
        background: #1a1a2e !important;
        color: white !important;
        border-radius: 0 !important;
        padding: 8px 12px !important;
        margin: 6px 0 !important;
        border: 2px solid #1a1a2e !important;
    }

    .total-label { font-size: 8pt !important; margin-bottom: 2px !important; }
    .total-value { font-size: 14pt !important; margin-bottom: 1px !important; }
    .total-words { font-size: 7pt !important; }

    /* Lampiran Print */
    .lampiran-section {
        display: block !important;
        page-break-before: always !important;
        break-before: page !important;
        margin-top: 0 !important;
        border: 1px solid #333 !important;
        border-radius: 0 !important;
    }

    .lampiran-header {
        background: #1a1a2e !important;
        color: white !important;
        padding: 6px 10px !important;
        border-bottom: 1.5px solid #1a1a2e !important;
    }

    .lampiran-header h3 {
        font-size: 10pt !important;
        margin-bottom: 1px !important;
    }

    .lampiran-header p {
        font-size: 7.5pt !important;
    }

    .lampiran-pasal {
        border-bottom: 1px solid #ddd !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .lampiran-pasal-title {
        background: #f5f5f3 !important;
        padding: 3px 10px !important;
        font-size: 8.5pt !important;
        border-left: 2px solid #e85d4e !important;
    }

    .lampiran-pasal-content {
        padding: 5px 10px !important;
        font-size: 7pt !important;
        line-height: 1.3 !important;
        color: #333 !important;
    }

    .result-section::after {
        content: "Dokumen dihasilkan oleh Kalkulator PHK | PP No. 35 Tahun 2021";
        display: block;
        text-align: center;
        font-size: 6.5pt;
        color: #999;
        margin-top: 6px;
        padding-top: 4px;
        border-top: 1px solid #ddd;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .header { padding: 32px 0 24px; }
    .header h1 { font-size: 22px; }
    .subtitle { font-size: 14px; }

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

    .form-group-full { grid-column: span 1; }

    .section-block { margin-bottom: 32px; }
    .actions { flex-direction: column; gap: 8px; }
    .btn-primary, .btn-text { width: 100%; justify-content: center; }

    .summary-grid { grid-template-columns: 1fr; }
    .result-title { flex-direction: column; gap: 4px; }
    .result-item-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .result-item-value { font-size: 14px; }
    .total-value { font-size: 22px; }
    .result-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .header h1 { font-size: 20px; }
    .input-pair { flex-wrap: wrap; }
    .input-pair input { min-width: 80px; }
    .section-header { gap: 8px; }
    .section-number { width: 24px; height: 24px; font-size: 11px; }
    .section-header h2 { font-size: 14px; }
}
