/* ====================================================================
   Calculadora Sueldo Neto – WordPress Plugin Styles
   Scope: .csn-wrap – all selectors are prefixed to avoid theme conflicts
   ==================================================================== */

.csn-wrap {
    --csn-pink: #E979EC;
    --csn-pink-dark: #c94fd4;
    --csn-pink-light: rgba(233, 121, 236, 0.10);
    --csn-green: #35DA8F;
    --csn-green-dark: #22b872;
    --csn-green-light: rgba(53, 218, 143, 0.10);
    --csn-orange: #f59e0b;
    --csn-blue: #60a5fa;
    --csn-white: #ffffff;
    --csn-bg: #f5f3ff;
    --csn-surface: #ffffff;
    --csn-surface2: #faf9ff;
    --csn-border: #ece8f8;
    --csn-text: #1a1230;
    --csn-text-mid: #5a5270;
    --csn-text-soft: #9b95b0;
    --csn-shadow: 0 2px 20px rgba(180, 140, 220, 0.10);
    --csn-shadow-lg: 0 8px 40px rgba(180, 140, 220, 0.16);

    box-sizing: border-box;
    color: var(--csn-text);
    overflow-x: hidden;
    position: relative;
}

.csn-wrap *,
.csn-wrap *::before,
.csn-wrap *::after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

.csn-inner {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 52px 20px 80px;
}

/* ── Header ─────────────────────────────────────────────── */
.csn-header {
    text-align: center;
    margin-bottom: 44px;
    animation: csnFadeDown 0.65s ease both;
}

.csn-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--csn-pink-light);
    border: 1.5px solid rgba(233, 121, 236, 0.28);
    color: var(--csn-pink-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
}

.csn-wrap h1.csn-title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -1.5px;
    color: var(--csn-text);
    margin-bottom: 12px;
}

.csn-wrap h1.csn-title em {
    font-style: normal;
    color: var(--csn-pink);
}

.csn-wrap h1.csn-title b {
    font-style: normal;
    color: var(--csn-green-dark);
}

.csn-subtitle {
    color: var(--csn-text-soft);
    font-size: 14px;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── Cards ──────────────────────────────────────────────── */
.csn-card {
    background: var(--csn-surface);
    border: 1.5px solid var(--csn-border);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 16px;
    box-shadow: var(--csn-shadow);
    animation: csnFadeUp 0.65s ease both;
}

.csn-card:nth-child(2) {
    animation-delay: 0.06s;
}

.csn-card:nth-child(3) {
    animation-delay: 0.12s;
}

.csn-card-title {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--csn-text-soft);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.csn-card-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--csn-border);
}

/* ── Form grid ──────────────────────────────────────────── */
.csn-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 560px) {
    .csn-form-grid {
        grid-template-columns: 1fr;
    }

    .csn-card {
        padding: 22px 16px;
    }
}

.csn-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.csn-field.csn-full {
    grid-column: 1 / -1;
}

.csn-wrap label.csn-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--csn-text-mid);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: default;
}

/* ── Tooltip tip ─────────────────────────────────────────── */
.csn-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--csn-border);
    color: var(--csn-text-soft);
    font-size: 9px;
    font-weight: 700;
    cursor: help;
    position: relative;
}

.csn-tip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--csn-text);
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 8px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ── Inputs ──────────────────────────────────────────────── */
.csn-input-wrap {
    position: relative;
}

.csn-symbol {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--csn-pink);
    font-weight: 700;
    font-size: 14px;
    pointer-events: none;
}

.csn-wrap input[type="number"],
.csn-wrap select {
    width: 100%;
    background: var(--csn-surface2);
    border: 1.5px solid var(--csn-border);
    border-radius: 10px;
    color: var(--csn-text);
    font-size: 14px;
    font-weight: 500;
    padding: 11px 12px 11px 32px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.csn-wrap input[type="number"]::-webkit-inner-spin-button {
    display: none;
}

.csn-wrap select {
    padding-left: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23E979EC' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: var(--csn-surface2);
}

.csn-wrap input[type="number"]:focus,
.csn-wrap select:focus {
    border-color: var(--csn-pink);
    box-shadow: 0 0 0 3px rgba(233, 121, 236, 0.12);
}

/* ── Range slider ────────────────────────────────────────── */
.csn-wrap input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--csn-pink) 0%, var(--csn-pink) var(--pct, 20%), #e2ddf2 var(--pct, 20%));
    outline: none;
    cursor: pointer;
    padding: 0;
    border: none;
    margin-top: 6px;
}

.csn-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--csn-white);
    border: 2.5px solid var(--csn-pink);
    box-shadow: 0 2px 8px rgba(233, 121, 236, 0.28);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.csn-wrap input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 16px rgba(233, 121, 236, 0.5);
}

.csn-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--csn-text-soft);
    margin-top: 5px;
}

/* ── Pills ───────────────────────────────────────────────── */
.csn-pills {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.csn-pill {
    flex: 1;
    min-width: 60px;
    padding: 9px 8px;
    border-radius: 9px;
    border: 1.5px solid var(--csn-border);
    background: var(--csn-surface2);
    color: var(--csn-text-mid);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.16s;
}

.csn-pill:hover {
    border-color: var(--csn-pink);
    color: var(--csn-pink-dark);
}

.csn-pill.csn-active {
    background: var(--csn-pink-light);
    border-color: var(--csn-pink);
    color: var(--csn-pink-dark);
    font-weight: 700;
}

/* ── Checkbox row ────────────────────────────────────────── */
.csn-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--csn-border);
    background: var(--csn-surface2);
    cursor: pointer;
    transition: border-color 0.16s;
    user-select: none;
}

.csn-check-row:hover {
    border-color: var(--csn-pink);
}

.csn-check-row input[type="checkbox"] {
    display: none;
}

.csn-check-box {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 2px solid var(--csn-border);
    flex-shrink: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s;
    font-size: 10px;
    color: white;
}

.csn-check-row.csn-checked .csn-check-box {
    background: var(--csn-pink);
    border-color: var(--csn-pink);
}

.csn-check-row.csn-checked .csn-check-box::after {
    content: '✓';
}

.csn-check-row-text {
    font-size: 13px;
    color: var(--csn-text-mid);
    font-weight: 500;
}

.csn-check-row.csn-checked .csn-check-row-text {
    color: var(--csn-pink-dark);
    font-weight: 600;
}

/* ── Especie sub-fields ──────────────────────────────────── */
.csn-especie-fields {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.csn-especie-fields.csn-visible {
    display: grid;
}

@media(max-width:480px) {
    .csn-especie-fields {
        grid-template-columns: 1fr;
    }
}

/* ── Button ──────────────────────────────────────────────── */
.csn-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(130deg, var(--csn-pink) 0%, var(--csn-pink-dark) 100%);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(233, 121, 236, 0.32);
    margin-top: 12px;
}

.csn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(233, 121, 236, 0.44);
}

.csn-btn:active {
    transform: translateY(0);
}

/* ── Results card ────────────────────────────────────────── */
.csn-results-card {
    background: var(--csn-surface);
    border: 1.5px solid rgba(53, 218, 143, 0.28);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--csn-shadow-lg);
    display: none;
    animation: csnFadeUp 0.5s ease both;
}

.csn-results-card.csn-visible {
    display: block;
}

.csn-net-hero {
    text-align: center;
    padding: 26px 16px 28px;
    background: linear-gradient(135deg, rgba(53, 218, 143, 0.08) 0%, rgba(233, 121, 236, 0.05) 100%);
    border-radius: 14px;
    margin-bottom: 26px;
}

.csn-net-label {
    font-size: 10.5px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--csn-text-soft);
    margin-bottom: 8px;
    font-weight: 600;
}

.csn-net-amount {
    font-size: clamp(36px, 7.5vw, 58px);
    font-weight: 800;
    color: var(--csn-green-dark);
    line-height: 1;
    letter-spacing: -2px;
}

.csn-net-monthly {
    font-size: 13.5px;
    color: var(--csn-text-soft);
    margin-top: 8px;
}

.csn-net-monthly strong {
    color: var(--csn-green-dark);
    font-weight: 700;
}

/* ── Breakdown ───────────────────────────────────────────── */
.csn-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 10px;
    background: var(--csn-surface2);
    border: 1px solid var(--csn-border);
    transition: border-color 0.14s;
}

.csn-row:hover {
    border-color: rgba(233, 121, 236, 0.2);
}

.csn-row.csn-indent {
    margin-left: 20px;
    opacity: 0.85;
}

.csn-row.csn-indent .csn-row-label {
    font-size: 12.5px;
}

.csn-row-label {
    font-size: 13.5px;
    color: var(--csn-text-mid);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.csn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.csn-dot-gross {
    background: var(--csn-text-mid);
}

.csn-dot-ss {
    background: var(--csn-pink);
}

.csn-dot-mei {
    background: #f472b6;
}

.csn-dot-irpf {
    background: var(--csn-orange);
}

.csn-dot-red {
    background: var(--csn-blue);
}

.csn-dot-esp {
    background: #a78bfa;
}

.csn-dot-net {
    background: var(--csn-green);
}

.csn-row-value {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
}

.csn-row-value.csn-minus {
    color: var(--csn-pink-dark);
}

.csn-row-value.csn-plus {
    color: var(--csn-green-dark);
}

.csn-row-value.csn-neutral {
    color: var(--csn-text);
}

.csn-row-value.csn-saving {
    color: var(--csn-blue);
}

.csn-row-pct {
    font-size: 10.5px;
    color: var(--csn-text-soft);
    font-weight: 400;
    margin-left: 3px;
}

.csn-divider {
    height: 1px;
    background: var(--csn-border);
    margin: 4px 0;
}

.csn-row-net-final {
    background: rgba(53, 218, 143, 0.08) !important;
    border: 1.5px solid rgba(53, 218, 143, 0.24) !important;
}

/* ── Tipos efectivos chips ───────────────────────────────── */
.csn-tipos-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

@media(max-width:480px) {
    .csn-tipos-row {
        grid-template-columns: 1fr;
    }
}

.csn-tipo-chip {
    background: var(--csn-surface2);
    border: 1.5px solid var(--csn-border);
    border-radius: 11px;
    padding: 13px 12px;
    text-align: center;
    transition: border-color 0.14s;
}

.csn-tipo-chip:hover {
    border-color: var(--csn-pink);
}

.csn-tipo-val {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.csn-tipo-lbl {
    font-size: 10px;
    color: var(--csn-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

/* ── Bar ─────────────────────────────────────────────────── */
.csn-bar-section {
    margin-top: 22px;
}

.csn-bar-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--csn-text-soft);
    margin-bottom: 7px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.csn-bar-track {
    height: 10px;
    border-radius: 100px;
    background: var(--csn-border);
    overflow: hidden;
    display: flex;
}

.csn-bar-fill {
    height: 100%;
    transition: width 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.csn-bar-net {
    background: var(--csn-green);
}

.csn-bar-ss {
    background: var(--csn-pink);
}

.csn-bar-irpf {
    background: var(--csn-orange);
}

.csn-bar-legend {
    display: flex;
    gap: 14px;
    margin-top: 9px;
    flex-wrap: wrap;
}

.csn-leg-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--csn-text-mid);
    font-weight: 500;
}

.csn-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Extras grid ─────────────────────────────────────────── */
.csn-extras-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

@media(max-width:480px) {
    .csn-extras-grid {
        grid-template-columns: 1fr;
    }
}

.csn-extra-box {
    background: var(--csn-surface2);
    border: 1.5px solid var(--csn-border);
    border-radius: 11px;
    padding: 14px 10px;
    text-align: center;
    transition: border-color 0.14s;
}

.csn-extra-box:hover {
    border-color: var(--csn-pink);
}

.csn-ex-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--csn-text);
    margin-bottom: 3px;
}

.csn-ex-label {
    font-size: 10px;
    color: var(--csn-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ── Info box ────────────────────────────────────────────── */
.csn-info-box {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    color: var(--csn-text-mid);
    line-height: 1.55;
    margin-top: 16px;
}

.csn-info-box strong {
    color: #3b82f6;
}

.csn-nota {
    margin-top: 16px;
    font-size: 11px;
    color: var(--csn-text-soft);
    text-align: center;
    line-height: 1.6;
    font-style: italic;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes csnFadeDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes csnFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Plugin footer ───────────────────────────────────────── */
.csn-plugin-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--csn-surface2);
    border: 1px solid var(--csn-border);
    font-size: 11.5px;
    color: var(--csn-text-soft);
    font-weight: 500;
}

.csn-footer-sep {
    opacity: 0.4;
    font-size: 13px;
}

.csn-plugin-footer a {
    color: var(--csn-pink-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.16s;
}

.csn-plugin-footer a:hover {
    color: var(--csn-pink);
    text-decoration: underline;
}