/* ===================================================
   Elementor Calculator Widget — calculator.css
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Serif+Display:ital@0;1&display=swap');

/* ── Wrapper ─────────────────────────────────────── */
.ecw-wrapper {
    width: 100%;
    font-family: 'DM Sans', sans-serif;
    color: #1A1A2E;
}

/* ── Header ──────────────────────────────────────── */
.ecw-header {
    margin-bottom: 24px;
}

.ecw-title {
    font-family: 'DM Serif Display', serif;
    font-size: 30px;
    color: #1A1A2E;
    line-height: 1.2;
    margin: 0 0 6px 0 !important;
}

.ecw-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 0 !important;
}

/* ── Progress Bar ────────────────────────────────── */
.ecw-progress-bar {
    height: 3px;
    background: #E5E7EB;
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ecw-progress-fill {
    height: 100%;
    background: #1A1A2E;
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* ── Card ────────────────────────────────────────── */
.ecw-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

/* ── Question Block ──────────────────────────────── */
.ecw-question {
    padding: 24px 28px;
    border-bottom: 1px solid #E5E7EB;
    animation: ecw-slide-in 0.25s ease forwards;
}

.ecw-question:last-of-type {
    border-bottom: none;
}

.ecw-question.ecw-hidden {
    display: none !important;
}

@keyframes ecw-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ecw-question-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.ecw-question-number {
    width: 24px;
    height: 24px;
    background: #1A1A2E;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
}

.ecw-question-text {
    font-size: 15px;
    font-weight: 500;
    color: #1A1A2E;
    line-height: 1.4;
    flex: 1;
}

.ecw-optional {
    font-size: 11px;
    color: #9CA3AF;
    background: #F3F4F6;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Radio Buttons ───────────────────────────────── */
.ecw-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ecw-radio-item {
    position: relative;
    flex: 1 1 auto;
    min-width: 110px;
}

.ecw-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ecw-radio-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    background: #F9FAFB;
    user-select: none;
    gap: 8px;
}

.ecw-radio-label:hover {
    border-color: #1A1A2E;
    background: #F3F4F6;
}

.ecw-radio-item input[type="radio"]:checked + .ecw-radio-label {
    border-color: #1A1A2E;
    background: #1A1A2E;
    color: #ffffff;
}

.ecw-radio-name {
    font-size: 14px;
    font-weight: 500;
}

.ecw-radio-value {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.6;
    white-space: nowrap;
}

.ecw-radio-item input[type="radio"]:checked + .ecw-radio-label .ecw-radio-value {
    opacity: 1;
    color: #E8C547;
}

/* ── Dropdown ────────────────────────────────────── */
.ecw-select-wrapper {
    position: relative;
}

.ecw-select {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1A1A2E;
    background: #F9FAFB;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.18s ease;
    outline: none;
}

.ecw-select:focus {
    border-color: #1A1A2E;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,26,46,0.06);
}

.ecw-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9CA3AF;
}

/* ── Checkboxes ──────────────────────────────────── */
.ecw-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ecw-checkbox-item {
    position: relative;
}

.ecw-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ecw-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    background: #F9FAFB;
    user-select: none;
}

.ecw-checkbox-label:hover {
    border-color: #1A1A2E;
}

.ecw-checkbox-item input[type="checkbox"]:checked + .ecw-checkbox-label {
    border-color: #1A1A2E;
    background: #F0F0F5;
}

.ecw-checkbox-box {
    width: 20px;
    height: 20px;
    border: 1.5px solid #D1D5DB;
    border-radius: 5px;
    flex-shrink: 0;
    background: #fff;
    transition: all 0.18s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ecw-checkbox-box-inner {
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

.ecw-checkbox-item input[type="checkbox"]:checked + .ecw-checkbox-label .ecw-checkbox-box {
    border-color: #1A1A2E;
}

.ecw-checkbox-item input[type="checkbox"]:checked + .ecw-checkbox-label .ecw-checkbox-box-inner {
    background: #1A1A2E;
}

.ecw-checkbox-check {
    width: 10px;
    height: 10px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ecw-checkbox-item input[type="checkbox"]:checked + .ecw-checkbox-label .ecw-checkbox-check {
    opacity: 1;
}

.ecw-checkbox-text {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    color: #1A1A2E;
}

.ecw-checkbox-price {
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
}

.ecw-checkbox-item input[type="checkbox"]:checked + .ecw-checkbox-label .ecw-checkbox-price {
    color: #1A1A2E;
}

/* ── Total Section ───────────────────────────────── */
.ecw-total-section {
    background: #1A1A2E;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.ecw-total-info {
    flex: 1;
}

.ecw-total-label-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 4px;
    font-family: 'DM Sans', sans-serif;
}

.ecw-total-amount {
    display: flex;
    align-items: baseline;
    gap: 3px;
    line-height: 1;
}

.ecw-total-currency {
    font-size: 20px;
    color: #E8C547;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
}

.ecw-total-number {
    font-family: 'DM Serif Display', serif;
    font-size: 38px;
    color: #FFFFFF;
    line-height: 1;
    transition: color 0.2s;
}

.ecw-total-breakdown {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
    min-height: 16px;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.3s ease;
    word-break: break-word;
}

/* ── Button ──────────────────────────────────────── */
.ecw-action {
    padding: 0 28px 24px;
    background: #1A1A2E;
}

.ecw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: #E8C547;
    color: #1A1A2E;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none !important;
    box-sizing: border-box;
}

.ecw-btn:hover {
    background: #D4AF37;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232,197,71,0.4);
    color: #1A1A2E;
    text-decoration: none !important;
}

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

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
    .ecw-question      { padding: 18px 16px; }
    .ecw-total-section { padding: 18px 16px; }
    .ecw-action        { padding: 0 16px 18px; }
    .ecw-radio-group   { flex-direction: column; }
    .ecw-radio-item    { min-width: unset; }
    .ecw-total-number  { font-size: 30px; }
}

/* ── Number Input (v1.2) ─────────────────────────── */
.ecw-number-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ecw-number-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1A1A2E;
    background: #F9FAFB;
    appearance: none;
    outline: none;
    transition: all 0.18s ease;
    letter-spacing: 0.02em;
    -moz-appearance: textfield;
}

.ecw-number-input::placeholder {
    color: #D1D5DB;
    font-weight: 400;
}

.ecw-number-input:focus {
    border-color: #1A1A2E;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,26,46,0.06);
}

.ecw-number-hint {
    font-size: 11px;
    color: #9CA3AF;
    font-style: italic;
    padding-left: 2px;
}

/* Negative total styling */
.ecw-total-number.is-negative {
    color: #F87171;
}

/* ── Number direction indicator (v1.3) ──────────── */
.ecw-number-wrapper {
    position: relative;
}

.ecw-number-direction {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.ecw-number-direction.is-add {
    background: #DCFCE7;
    color: #15803D;
}

.ecw-number-direction.is-deduct {
    background: #FEE2E2;
    color: #DC2626;
}

.ecw-number-direction svg {
    flex-shrink: 0;
}

/* ── Multiply badge (v1.4) ───────────────────────── */
.ecw-number-direction.is-multiply {
    background: #EDE9FE;
    color: #6D28D9;
}

/* Allow decimal input in multiply mode */
.ecw-number-input[data-allow-decimal="1"] {
    letter-spacing: 0.01em;
}

/* ── Number field validation error (v1.4.1) ─────── */
.ecw-number-error {
    display: none;
    font-size: 12px;
    font-weight: 600;
    color: #DC2626;
    margin-top: 6px;
    padding: 0 2px;
    animation: ecw-error-in 0.18s ease forwards;
}

@keyframes ecw-error-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ecw-number-input.ecw-input-error {
    border-color: #DC2626 !important;
    background: #FEF2F2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10) !important;
}
