/* ============================================
   SALARY CALCULATOR - FIGMA LEVEL CSS
   Version 1.0
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Reset */
.sal-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.sal-wrap {
    --sky:          #0EA5E9;
    --sky-dark:     #0369A1;
    --sky-light:    #F0F9FF;
    --cyan:         #06B6D4;
    --green:        #10B981;
    --green-light:  #ECFDF5;
    --red:          #EF4444;
    --red-light:    #FEF2F2;
    --blue:         #3B82F6;
    --blue-light:   #EFF6FF;
    --grad:         linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    --grad-soft:    linear-gradient(135deg,
                    rgba(14,165,233,0.07) 0%,
                    rgba(6,182,212,0.07) 100%);
    --white:        #FFFFFF;
    --bg:           #F0F9FF;
    --border:       rgba(14,165,233,0.15);
    --text:         #1A1A2E;
    --text-muted:   #6B7280;
    --shadow:       0 32px 80px rgba(14,165,233,0.16),
                    0 8px 24px rgba(6,182,212,0.10);
    --shadow-btn:   0 12px 32px rgba(14,165,233,0.40);
    --radius-xl:    24px;
    --radius-lg:    16px;
    --radius-md:    12px;
    --radius-sm:    8px;
    font-family: 'Inter', sans-serif;
    position: relative;
    padding: 40px 16px;
    background: var(--bg);
}

/* Blobs */
.sal-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}
.sal-blob-1 {
    width: 320px; height: 320px;
    background: rgba(14,165,233,0.10);
    top: -80px; left: -80px;
}
.sal-blob-2 {
    width: 260px; height: 260px;
    background: rgba(6,182,212,0.09);
    bottom: 20px; right: -60px;
}
.sal-blob-3 {
    width: 200px; height: 200px;
    background: rgba(16,185,129,0.07);
    top: 40%; left: 40%;
}

/* Card */
.sal-card {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Header */
.sal-header {
    background: var(--grad);
    padding: 26px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.sal-header::after {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -90px; right: -60px;
}

.sal-header::before {
    content: '';
    position: absolute;
    width: 140px; height: 140px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -50px; left: 35%;
}

.sal-header-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
}

.sal-header-text h2 {
    color: white;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.sal-header-text p {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    margin-top: 3px;
}

/* Tabs */
.sal-tabs {
    display: flex;
    padding: 16px 32px 0;
    gap: 4px;
    background: white;
    border-bottom: 2px solid var(--border);
}

.sal-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.sal-tab:hover {
    color: var(--sky);
    background: rgba(14,165,233,0.04);
}

.sal-tab-active {
    color: var(--sky) !important;
    border-bottom: 3px solid var(--sky) !important;
    background: rgba(14,165,233,0.06) !important;
}

/* Body */
.sal-body {
    padding: 32px;
}

/* Layout */
.sal-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Inputs */
.sal-inputs {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Field Group */
.sal-field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Step Label */
.sal-step-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sal-step-num {
    width: 26px; height: 26px;
    background: var(--grad);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(14,165,233,0.35);
}

.sal-step-label span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* Input Wrap */
.sal-input-wrap {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #F0F9FF;
    transition: all 0.25s ease;
}

.sal-input-wrap:focus-within {
    border-color: var(--sky);
    background: white;
    box-shadow: 0 0 0 4px rgba(14,165,233,0.08);
}

.sal-input-wrap:hover {
    border-color: rgba(14,165,233,0.30);
}

.sal-input-prefix,
.sal-input-suffix {
    padding: 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--sky);
    background: rgba(14,165,233,0.08);
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.sal-input-prefix {
    border-right: 1.5px solid var(--border);
}

.sal-input-suffix {
    border-left: 1.5px solid var(--border);
}

.sal-input-wrap input {
    width: 100%;
    padding: 13px 14px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    outline: none;
    -moz-appearance: textfield;
}

.sal-input-wrap input::-webkit-inner-spin-button,
.sal-input-wrap input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sal-input-wrap input::placeholder {
    color: #CBD5E1;
    font-weight: 400;
}

/* Hint */
.sal-hint {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 4px;
}

/* Toggle Row */
.sal-toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sal-pf-note {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Toggle Wrap */
.sal-toggle-wrap {
    display: flex;
    gap: 6px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.sal-toggle-btn {
    padding: 8px 18px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.sal-toggle-btn:hover {
    color: var(--sky);
}

.sal-toggle-active {
    background: white !important;
    color: var(--sky) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10) !important;
}

/* Calculate Button */
#sal_btn {
    width: 100%;
    padding: 15px 24px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-btn);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

#sal_btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.15),
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s;
}

#sal_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(14,165,233,0.45);
}

#sal_btn:hover::before { opacity: 1; }
#sal_btn:active { transform: translateY(0); }

.sal-btn-icon {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.20);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Results */
.sal-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

.sal-results-visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Take Home Card */
.sal-takehome-card {
    background: var(--grad);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(14,165,233,0.25);
}

.sal-takehome-card::before {
    content: '';
    position: absolute;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -60px; right: -40px;
}

.sal-takehome-label {
    color: rgba(255,255,255,0.80);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.sal-takehome-value {
    color: white;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 10px;
}

.sal-takehome-annual {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
}

.sal-takehome-annual span {
    font-weight: 700;
    color: white;
}

/* Breakdown Wrap */
.sal-breakdown-wrap {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sal-breakdown-title {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    background: #F8FDFF;
    border-bottom: 1.5px solid var(--border);
}

.sal-section-title {
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sal-earn-title {
    background: #F0FDF4;
    color: #065F46;
    border-bottom: 1px solid #D1FAE5;
}

.sal-deduct-title {
    background: #FEF2F2;
    color: #991B1B;
    border-bottom: 1px solid #FECACA;
    margin-top: 4px;
}

/* Breakdown Item */
.sal-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.2s;
}

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

.sal-breakdown-item:hover {
    background: #F8FDFF;
}

.sal-item-total {
    background: #F8FDFF !important;
    border-top: 1.5px solid var(--border) !important;
}

.sal-item-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.sal-item-total .sal-item-label {
    font-weight: 700;
    color: var(--text);
}

.sal-item-value {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sal-item-total .sal-item-value {
    font-size: 15px;
    font-weight: 800;
}

/* Colors */
.sal-color-green  { color: var(--green); }
.sal-color-blue   { color: var(--blue); }
.sal-color-red    { color: var(--red); }

/* CTC/Monthly Fields flex direction */
#sal_ctc_fields,
#sal_monthly_fields {
    flex-direction: column;
    gap: 22px;
}

/* Footer */
.sal-footer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 32px 24px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border);
    background: #F8FDFF;
}

.sal-footer svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--sky);
}

/* Tablet */
@media (max-width: 820px) {
    .sal-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .sal-results {
        transform: translateY(20px) !important;
        border-top: 1px solid var(--border);
        padding-top: 24px;
    }
    .sal-results-visible {
        transform: translateY(0) !important;
    }
    .sal-body { padding: 24px; }
    .sal-tabs { padding: 14px 24px 0; }
    .sal-footer { padding: 14px 24px 20px; }
}

/* Mobile */
@media (max-width: 500px) {
    .sal-wrap { padding: 20px 10px; }
    .sal-card { border-radius: var(--radius-lg); }
    .sal-header { padding: 20px; }
    .sal-header-text h2 { font-size: 18px; }
    .sal-body { padding: 20px; }
    .sal-tabs {
        padding: 12px 20px 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .sal-tabs::-webkit-scrollbar { display: none; }
    .sal-tab { padding: 8px 16px; font-size: 13px; }
    .sal-footer { padding: 14px 20px 20px; }
    .sal-takehome-value { font-size: 28px; }
    .sal-toggle-btn { padding: 7px 14px; font-size: 12px; }
}
