/* ══════════════════════════════════════════════════
   Notary Payout Calculator — Stylesheet
   Aesthetic: Industrial-ledger meets modern finance
   ══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

/* ─── CSS Variables ─────────────────────────── */
#npc-calculator {
    --npc-bg:          #0e0f13;
    --npc-surface:     #16181f;
    --npc-surface2:    #1e2029;
    --npc-border:      #2a2d3a;
    --npc-accent:      #c9a84c;
    --npc-accent-dim:  #8a6e2f;
    --npc-green:       #3ec98e;
    --npc-blue:        #4e9eff;
    --npc-red:         #ef4444;
    --npc-text:        #e8e9ed;
    --npc-muted:       #6b7080;
    --npc-label:       #9ca3af;
    --npc-radius:      12px;
    --npc-radius-sm:   8px;
    --npc-font-head:   'Syne', sans-serif;
    --npc-font-body:   'DM Sans', sans-serif;
    --npc-font-mono:   'DM Mono', monospace;
    --npc-shadow:      0 4px 24px rgba(0,0,0,0.4);
    --npc-glow:        0 0 20px rgba(201,168,76,0.15);
}

/* ─── Wrapper ───────────────────────────────── */
#npc-calculator {
    background: var(--npc-bg);
    color: var(--npc-text);
    font-family: var(--npc-font-body);
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--npc-shadow);
}

/* ─── Header ────────────────────────────────── */
.npc-header {
    background: linear-gradient(135deg, #1a1c25 0%, #0e0f13 100%);
    border-bottom: 1px solid var(--npc-border);
    padding: 48px 40px 36px;
    position: relative;
    overflow: hidden;
}

.npc-header::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(201,168,76,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.npc-header-badge {
    display: inline-block;
    font-family: var(--npc-font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--npc-accent);
    border: 1px solid var(--npc-accent-dim);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.npc-title {
    font-family: var(--npc-font-head);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    color: var(--npc-text);
}

.npc-title-accent {
    color: var(--npc-accent);
}

.npc-subtitle {
    font-family: var(--npc-font-mono);
    font-size: 13px;
    color: var(--npc-muted);
    margin: 0;
}

/* ─── Sections ──────────────────────────────── */
.npc-section {
    padding: 32px 40px;
    border-bottom: 1px solid var(--npc-border);
    position: relative;
}

.npc-section-label {
    font-family: var(--npc-font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--npc-accent);
    letter-spacing: 0.15em;
    margin-bottom: 6px;
}

.npc-section-title {
    font-family: var(--npc-font-head);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--npc-text);
}

.npc-section-desc {
    font-size: 13px;
    color: var(--npc-muted);
    margin: 0 0 20px;
    font-family: var(--npc-font-mono);
}

/* ─── Toggle Buttons ────────────────────────── */
.npc-toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.npc-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--npc-surface2);
    border: 1px solid var(--npc-border);
    border-radius: var(--npc-radius-sm);
    color: var(--npc-label);
    font-family: var(--npc-font-body);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.npc-toggle:hover {
    border-color: var(--npc-accent-dim);
    color: var(--npc-text);
}

.npc-toggle.active {
    background: rgba(201,168,76,0.12);
    border-color: var(--npc-accent);
    color: var(--npc-accent);
    box-shadow: var(--npc-glow);
}

.npc-toggle-icon {
    font-size: 18px;
    line-height: 1;
}

.npc-toggle-group--sm .npc-toggle,
.npc-toggle--sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ─── CC Fee Row ────────────────────────────── */
.npc-cc-fee-row {
    margin-top: 20px;
    padding: 16px;
    background: rgba(78,158,255,0.06);
    border: 1px solid rgba(78,158,255,0.2);
    border-radius: var(--npc-radius-sm);
}

.npc-cc-fee-label {
    font-size: 14px;
    color: var(--npc-label);
    margin: 0 0 10px;
}

/* ─── Field Row ─────────────────────────────── */
.npc-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.npc-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--npc-label);
}

.npc-input-wrap {
    flex-shrink: 0;
}

.npc-input-wrap--sm {
    width: 100px;
}

.npc-input {
    background: var(--npc-surface2);
    border: 1px solid var(--npc-border);
    border-radius: var(--npc-radius-sm);
    color: var(--npc-text);
    font-family: var(--npc-font-mono);
    font-size: 20px;
    font-weight: 500;
    padding: 10px 16px;
    width: 120px;
    text-align: center;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.npc-input::-webkit-inner-spin-button,
.npc-input::-webkit-outer-spin-button { opacity: 0.4; }

.npc-input:focus {
    outline: none;
    border-color: var(--npc-accent);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

/* ─── Travel Grid ───────────────────────────── */
.npc-travel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.npc-travel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    background: var(--npc-surface2);
    border: 1px solid var(--npc-border);
    border-radius: var(--npc-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.npc-travel-card input[type="radio"] {
    display: none;
}

.npc-travel-card:hover {
    border-color: var(--npc-accent-dim);
}

.npc-travel-card:has(input:checked) {
    background: rgba(201,168,76,0.1);
    border-color: var(--npc-accent);
    box-shadow: var(--npc-glow);
}

.npc-travel-badge {
    font-family: var(--npc-font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--npc-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.npc-travel-amount {
    font-family: var(--npc-font-mono);
    font-size: 18px;
    font-weight: 500;
    color: var(--npc-text);
}

.npc-travel-split {
    font-size: 10px;
    color: var(--npc-muted);
    font-family: var(--npc-font-mono);
}

.npc-travel-card:has(input:checked) .npc-travel-badge { color: var(--npc-accent); }
.npc-travel-card:has(input:checked) .npc-travel-amount { color: var(--npc-accent); }

/* ─── Split Row ─────────────────────────────── */
.npc-split-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.npc-split-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(62,201,142,0.06);
    border: 1px solid rgba(62,201,142,0.2);
    border-radius: var(--npc-radius-sm);
}

/* ─── Calculate Button ──────────────────────── */
.npc-calc-row {
    padding: 28px 40px 8px;
    display: flex;
    justify-content: flex-end;
}

.npc-btn-calc {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--npc-accent);
    color: #0e0f13;
    border: none;
    border-radius: var(--npc-radius-sm);
    font-family: var(--npc-font-head);
    font-size: 16px;
    font-weight: 700;
    padding: 14px 28px;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}

.npc-btn-calc:hover {
    background: #d9b85a;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(201,168,76,0.4);
}

.npc-btn-calc:active {
    transform: translateY(0);
}

/* ─── Results Panel ─────────────────────────── */
.npc-results {
    margin: 24px 40px 0;
    animation: npcFadeUp 0.4s ease forwards;
}

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

.npc-results-title {
    font-family: var(--npc-font-head);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--npc-text);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--npc-border);
}

.npc-results-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.npc-result-card {
    background: var(--npc-surface);
    border: 1px solid var(--npc-border);
    border-radius: var(--npc-radius);
    padding: 18px 20px;
    border-left-width: 3px;
}

.npc-result-card--notary { border-left-color: var(--npc-blue); }
.npc-result-card--travel  { border-left-color: var(--npc-green); }
.npc-result-card--penalty { border-left-color: var(--npc-red); }

.npc-result-label {
    font-size: 12px;
    font-family: var(--npc-font-mono);
    font-weight: 500;
    color: var(--npc-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.npc-result-total {
    font-family: var(--npc-font-mono);
    font-size: 24px;
    font-weight: 500;
    color: var(--npc-text);
    margin-bottom: 12px;
}

.npc-result-splits {
    display: flex;
    gap: 24px;
}

.npc-result-split-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.npc-result-split-item span {
    font-size: 11px;
    color: var(--npc-muted);
    font-family: var(--npc-font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.npc-result-split-item strong {
    font-family: var(--npc-font-mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--npc-text);
}

.npc-penalty-note {
    font-size: 12px;
    color: #ef4444;
    margin: 8px 0 0;
    font-style: italic;
}

/* ─── Grand Total ───────────────────────────── */
.npc-grand-total {
    background: var(--npc-surface2);
    border: 1px solid var(--npc-border);
    border-radius: var(--npc-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.npc-grand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 15px;
}

.npc-grand-row span {
    color: var(--npc-label);
    font-weight: 500;
}

.npc-grand-row strong {
    font-family: var(--npc-font-mono);
    font-size: 18px;
    color: var(--npc-text);
}

.npc-grand-row--emp strong { color: var(--npc-green); }
.npc-grand-row--biz strong { color: var(--npc-blue); }

.npc-grand-divider {
    height: 1px;
    background: var(--npc-border);
    margin: 10px 0;
}

/* ─── Per Agent ─────────────────────────────── */
.npc-per-agent {
    background: rgba(62,201,142,0.08);
    border: 1px solid rgba(62,201,142,0.3);
    border-radius: var(--npc-radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.npc-per-agent-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.npc-per-agent-label {
    font-size: 13px;
    color: var(--npc-muted);
    font-family: var(--npc-font-mono);
    flex: 1;
}

.npc-per-agent-amount {
    font-family: var(--npc-font-mono);
    font-size: 26px;
    font-weight: 500;
    color: var(--npc-green);
}

/* ─── Reset Button ──────────────────────────── */
.npc-reset-row {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

.npc-btn-reset {
    background: transparent;
    border: 1px solid var(--npc-border);
    border-radius: var(--npc-radius-sm);
    color: var(--npc-muted);
    font-family: var(--npc-font-body);
    font-size: 13px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.npc-btn-reset:hover {
    border-color: var(--npc-accent-dim);
    color: var(--npc-accent);
}

/* ─── Utility ───────────────────────────────── */
.npc-hidden { display: none !important; }

/* ─── Responsive ────────────────────────────── */
@media (max-width: 560px) {
    .npc-header,
    .npc-section {
        padding-left: 24px;
        padding-right: 24px;
    }
    .npc-calc-row,
    .npc-results {
        margin-left: 0;
        margin-right: 0;
        padding-left: 24px;
        padding-right: 24px;
    }
    .npc-results {
        margin-left: 24px;
        margin-right: 24px;
    }
    .npc-travel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .npc-field-row,
    .npc-split-toggle-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .npc-per-agent {
        flex-direction: column;
        text-align: center;
    }
}
