* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
   background: linear-gradient(135deg, #043145 0%, #043145 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(87, 140, 200, 0.15);
    color: #578cc8;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 24px;
}

.badge::before {
    content: "📊";
}

h1 {
    color: #ffffff;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.subtitle {
    color: #b8d4f0;
    font-size: 16px;
    text-align: center;
    margin-bottom: 40px;
}

.calculator-card {
    background: rgba(10, 74, 97, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(87, 140, 200, 0.1);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

input, select {
    background: rgba(4, 49, 69, 0.8);
    border: 1px solid #1a5570;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #578cc8;
    background: rgba(10, 74, 97, 0.95);
}

input::placeholder {
    color: #b8d4f0;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b8d4f0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #578cc8 0%, #6ba3d0 100%);
    color: #043145;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.calculate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(87, 140, 200, 0.4);
}

.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.calculate-btn::after {
    content: "→";
    font-size: 20px;
}

.calculate-btn:disabled::after {
    content: "";
}

.loading {
    display: none;
}

.loading.active {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.results-card {
    display: none;
    background: rgba(10, 74, 97, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(87, 140, 200, 0.2);
    border-radius: 16px;
    padding: 32px;
    margin-top: 24px;
}

.results-card.show {
    display: block;
    animation: slideIn 0.4s ease;
}

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

.savings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.savings-icon {
    width: 48px;
    height: 48px;
    background: rgba(87, 140, 200, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.savings-header h2 {
    color: #ffffff;
    font-size: 24px;
}

.savings-amount {
    background: linear-gradient(135deg, rgba(87, 140, 200, 0.2) 0%, rgba(87, 140, 200, 0.05) 100%);
    border: 1px solid rgba(87, 140, 200, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.savings-amount.loss {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.savings-left h3 {
    color: #b8d4f0;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 8px;
}

.savings-value {
    color: #5dd86e;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.savings-amount.loss .savings-value {
    color: #ef4444;
}

.savings-percentage {
    color: #5dd86e;
    font-size: 20px;
    font-weight: 600;
}

.savings-amount.loss .savings-percentage {
    color: #ef4444;
}

.checkmark {
    width: 48px;
    height: 48px;
    background: rgba(87, 140, 200, 0.2);
    border: 2px solid #578cc8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}
@media (max-width: 768px) {
    .checkmark {
    margin-top: -68px;
    }
}
.savings-message {
    color: #b8d4f0;
    font-size: 14px;
    line-height: 1.5;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.rate-card {
    background: rgba(4, 49, 69, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.rate-card.highlight {
    background: rgba(87, 140, 200, 0.1);
    border-color: rgba(87, 140, 200, 0.3);
}

.rate-label {
    color: #b8d4f0;
    font-size: 13px;
    margin-bottom: 8px;
}

.rate-value {
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.rate-card.highlight .rate-value {
    color: #578cc8;
}

.rate-margin {
    color: #578cc8;
    font-size: 12px;
}

.rate-margin.negative {
    color: #ef4444;
}

.comparison-section h3 {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 16px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.comparison-item {
    background: rgba(4, 49, 69, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.comparison-label {
    color: #b8d4f0;
    font-size: 13px;
    margin-bottom: 8px;
}

.comparison-value {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.api-mode-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(4, 49, 69, 0.6);
    border-radius: 8px;
}

.api-mode-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #ffffff;
}

.api-mode-toggle input[type="radio"] {
    width: auto;
    cursor: pointer;
}

@media (max-width: 768px) {
    h1 {
        font-size: 32px;
    }

    .form-grid,
    .rates-grid,
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .calculator-card {
        padding: 20px;
    }

    .savings-value {
        font-size: 28px;
    }

    .savings-amount {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
.api-mode-toggle {
    display: none;
}