/* =============================================
   Tax Free Calculator — WordPress Plugin CSS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700&family=Manrope:wght@400;500;600;700&display=swap');

.tfc-wrapper {
    --tfc-bg: #0f1117;
    --tfc-surface: #1a1d27;
    --tfc-surface2: #222535;
    --tfc-border: #2e3148;
    --tfc-accent: #3de8a0;
    --tfc-accent2: #2bc4ff;
    --tfc-text: #f0f2ff;
    --tfc-muted: #9fa4c4; /* Збільшено яскравість для кращої читабельності тексту */
    --tfc-danger: #ff6b6b;
    --tfc-warning: #ffb74d;
    --tfc-radius: 16px;
    --tfc-radius-sm: 12px; /* Трохи збільшено радіус для балансу */
    --tfc-font-display: 'Unbounded', sans-serif;
    --tfc-font-body: 'Manrope', sans-serif;

    font-family: var(--tfc-font-body);
    background: var(--tfc-bg);
    color: var(--tfc-text);
    border-radius: 24px;
    padding: 0;
    max-width: 620px;
    margin: 0 auto 40px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px var(--tfc-border);
    position: relative;
    box-sizing: border-box;
}

.tfc-wrapper * {
    box-sizing: border-box;
}

.tfc-wrapper::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(61,232,160,0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Header */
.tfc-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 32px;
    border-bottom: 1px solid var(--tfc-border);
    background: linear-gradient(135deg, #1a1d27 0%, #1e2133 100%);
}

.tfc-header-icon {
    color: var(--tfc-accent);
    background: rgba(61,232,160,0.1);
    border: 1px solid rgba(61,232,160,0.2);
    border-radius: 14px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tfc-title {
    font-family: var(--tfc-font-display);
    font-size: 1.35rem; /* Збільшено з 1.1rem */
    font-weight: 700;
    color: var(--tfc-text);
    margin: 0 0 6px;
    line-height: 1.3;
}

.tfc-subtitle {
    font-size: 0.95rem; /* Збільшено з 0.8rem */
    color: var(--tfc-muted);
    margin: 0;
    line-height: 1.4;
}

/* Body */
.tfc-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Field groups */
.tfc-field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tfc-label {
    font-size: 0.88rem; /* Збільшено з 0.82rem */
    font-weight: 700;
    color: var(--tfc-text); /* Текст міток став контрастнішим */
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tfc-label-icon {
    font-size: 1.1rem;
}

/* Select */
.tfc-select-wrapper {
    position: relative;
}

.tfc-select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tfc-muted);
    pointer-events: none;
    font-size: 1.1rem;
}

.tfc-select {
    width: 100%;
    padding: 16px 44px 16px 18px; /* Збільшено відступи */
    background: var(--tfc-surface);
    border: 1.5px solid var(--tfc-border);
    border-radius: var(--tfc-radius-sm);
    color: var(--tfc-text);
    font-family: var(--tfc-font-body);
    font-size: 1.05rem; /* Збільшено з 0.95rem — тепер ідеально для мобільних */
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.tfc-select:focus {
    border-color: var(--tfc-accent);
    box-shadow: 0 0 0 3px rgba(61,232,160,0.12);
}

.tfc-select option {
    background: #1a1d27;
    padding: 10px;
}

/* Country info badge */
.tfc-country-info {
    background: rgba(43,196,255,0.08);
    border: 1px solid rgba(43,196,255,0.2);
    border-radius: var(--tfc-radius-sm);
    padding: 12px 16px;
    font-size: 0.95rem; /* Збільшено з 0.85rem */
    color: var(--tfc-accent2);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tfc-country-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Input */
.tfc-input-wrapper {
    position: relative;
}

.tfc-input {
    width: 100%;
    padding: 16px 80px 16px 18px;
    background: var(--tfc-surface);
    border: 1.5px solid var(--tfc-border);
    border-radius: var(--tfc-radius-sm);
    color: var(--tfc-text);
    font-family: var(--tfc-font-display);
    font-size: 1.35rem; /* Збільшено для кращої видимості цифр */
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.tfc-input:focus {
    border-color: var(--tfc-accent);
    box-shadow: 0 0 0 3px rgba(61,232,160,0.12);
}

.tfc-input::placeholder {
    color: #383c56;
}

.tfc-currency-badge {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    font-family: var(--tfc-font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tfc-accent);
    background: rgba(61,232,160,0.08);
    border-left: 1px solid var(--tfc-border);
    border-radius: 0 var(--tfc-radius-sm) var(--tfc-radius-sm) 0;
}

/* Slider */
.tfc-slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tfc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px; /* Трохи товще, щоб легше влучати пальцем */
    background: var(--tfc-surface2);
    border-radius: 100px;
    outline: none;
    cursor: pointer;
}

.tfc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px; /* Збільшено з 22px для тач-екранів */
    height: 26px;
    background: var(--tfc-accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(61,232,160,0.2);
    transition: box-shadow 0.2s;
}

.tfc-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 8px rgba(61,232,160,0.15);
}

.tfc-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    background: var(--tfc-accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.tfc-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem; /* Збільшено з 0.78rem */
    color: var(--tfc-muted);
    font-weight: 500;
}

.tfc-slider-value {
    font-family: var(--tfc-font-display);
    font-weight: 700;
    color: var(--tfc-accent);
    font-size: 1rem; /* Збільшено */
}

.tfc-hint {
    font-size: 0.85rem; /* Збільшено з 0.78rem */
    color: var(--tfc-muted);
    margin: 4px 0 0;
    font-style: italic;
}

/* Button */
.tfc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 28px; /* Більша висота кнопки зручніша на мобільних */
    background: linear-gradient(135deg, var(--tfc-accent) 0%, #2bc4a0 100%);
    color: #0a1a12;
    border: none;
    border-radius: var(--tfc-radius-sm);
    font-family: var(--tfc-font-display);
    font-size: 1rem; /* Збільшено з 0.9rem */
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.03em;
    box-shadow: 0 8px 24px rgba(61,232,160,0.25);
}

.tfc-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(61,232,160,0.35);
}

/* Result block */
.tfc-result {
    margin: 0 32px 32px;
    background: var(--tfc-surface);
    border: 1px solid var(--tfc-border);
    border-radius: var(--tfc-radius);
    overflow: hidden;
    animation: tfc-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tfc-slide-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tfc-result-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: rgba(61,232,160,0.06);
    border-bottom: 1px solid var(--tfc-border);
}

.tfc-result-check {
    width: 32px;
    height: 32px;
    background: var(--tfc-accent);
    color: #0a1a12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tfc-result-title {
    font-family: var(--tfc-font-display);
    font-size: 1.05rem; /* Збільшено з 0.9rem */
    font-weight: 700;
    color: var(--tfc-text);
    margin: 0;
}

.tfc-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--tfc-border);
}

.tfc-result-card {
    background: var(--tfc-surface);
    padding: 22px 24px;
}

.tfc-result-highlight {
    background: var(--tfc-surface2);
    grid-column: 1 / -1;
}

.tfc-result-card-label {
    font-size: 0.82rem; /* Збільшено з 0.75rem */
    color: var(--tfc-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    font-weight: 600;
}

.tfc-result-card-value {
    font-family: var(--tfc-font-display);
    font-size: 1.35rem; /* Збільшено з 1.2rem */
    font-weight: 700;
    color: var(--tfc-text);
}

.tfc-result-highlight .tfc-result-card-value {
    font-size: 2.1rem; /* Великий, помітний результат */
    color: var(--tfc-accent);
}

.tfc-result-highlight .tfc-result-card-label {
    font-size: 0.9rem;
    color: var(--tfc-accent);
    opacity: 0.9;
}

/* Warning */
.tfc-warning {
    margin: 0 24px 20px;
    padding: 14px 18px;
    background: rgba(255,183,77,0.08);
    border: 1px solid rgba(255,183,77,0.25);
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem; /* Збільшено з 0.82rem */
    color: var(--tfc-warning);
    line-height: 1.45;
}

.tfc-warning svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.tfc-disclaimer {
    margin: 0;
    padding: 14px 24px 20px;
    font-size: 0.82rem; /* Збільшено з 0.75rem */
    color: var(--tfc-muted);
    font-style: italic;
    line-height: 1.5;
}

/* Steps section */
.tfc-steps {
    padding: 32px;
    border-top: 1px solid var(--tfc-border);
    background: var(--tfc-surface);
}

.tfc-steps-title {
    font-family: var(--tfc-font-display);
    font-size: 0.95rem; /* Збільшено з 0.85rem */
    font-weight: 700;
    color: var(--tfc-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 20px;
}

.tfc-steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Більше простору між кроками */
}

.tfc-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.tfc-step-num {
    width: 32px; /* Збільшено з 28px */
    height: 32px;
    background: rgba(43,196,255,0.1);
    border: 1px solid rgba(43,196,255,0.25);
    border-radius: 50%;
    color: var(--tfc-accent2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--tfc-font-display);
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tfc-step-text {
    font-size: 0.95rem; /* Збільшено з 0.87rem */
    color: var(--tfc-muted);
    line-height: 1.55;
    padding-top: 2px;
}

/* Shake Animation */
.tfc-shake {
    animation: tfc-shake-anim 0.4s ease-in-out;
}
@keyframes tfc-shake-anim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* =============================================
   Адаптивність для мобільних пристроїв (Mobile & Tablet)
   ============================================= */
@media (max-width: 580px) {
    .tfc-wrapper {
        border-radius: 16px;
        margin: 0 auto 20px;
    }
    .tfc-header { 
        padding: 24px 20px; 
        gap: 14px;
    }
    .tfc-header-icon {
        width: 50px;
        height: 50px;
    }
    .tfc-title { 
        font-size: 1.15rem; 
    }
    .tfc-subtitle {
        font-size: 0.88rem;
    }
    .tfc-body { 
        padding: 24px 20px; 
        gap: 22px;
    }
    .tfc-result { 
        margin: 0 20px 24px; 
    }
    .tfc-result-header {
        padding: 14px 18px;
    }
    
    /* Перебудова сітки результатів в один стовпчик на мобільних, 
       щоб великі суми та довгі валюти не наповзали одна на одну */
    .tfc-result-grid {
        grid-template-columns: 1fr;
    }
    .tfc-result-card {
        padding: 16px 18px;
    }
    .tfc-result-card-value {
        font-size: 1.25rem;
    }
    .tfc-result-highlight .tfc-result-card-value { 
        font-size: 1.75rem; 
    }
    
    .tfc-steps { 
        padding: 24px 20px; 
    }
    .tfc-step-text {
        font-size: 0.9rem;
    }
}