:root {
    --brt-red: #D5001C;
    --brt-red-dark: #A30015;
    --dark-grey: #333333;
    --light-grey: #F5F7FA;
    --white: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-grey);
    color: var(--dark-grey);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.red-blob {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--brt-red) 0%, rgba(213,0,28,0) 70%);
}

.grey-blob {
    bottom: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #a0aec0 0%, rgba(160,174,192,0) 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 900px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.brt-red {
    color: var(--brt-red);
    font-size: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-grey);
}

header p {
    font-size: 1.1rem;
    color: #666;
}

.calculator-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    flex-wrap: wrap;
}

.type-btn {
    background: transparent;
    border: 2px solid transparent;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.type-btn:hover {
    background: #edf2f7;
    color: var(--dark-grey);
}

.type-btn.active {
    background: white;
    border-color: var(--brt-red);
    color: var(--brt-red);
    box-shadow: 0 4px 12px rgba(213, 0, 28, 0.1);
}

.form-section {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    width: 100%;
}

.form-section.hidden {
    display: none;
}

.results-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.results-group.hidden {
    display: none;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.pallet-image-container {
    width: 100%;
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: white;
    padding: 1rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.pallet-image-container.hidden {
    display: none;
}

.pallet-image-container img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--dark-grey);
    font-size: 0.95rem;
}

select, input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    color: var(--dark-grey);
    background-color: var(--white);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

select:focus, input:focus {
    border-color: var(--brt-red);
    box-shadow: 0 0 0 4px rgba(213, 0, 28, 0.1);
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ccc, #999);
}

.result-card.monocollo::before { background: linear-gradient(90deg, #4299e1, #3182ce); }
.result-card.multicollo::before { background: linear-gradient(90deg, #48bb78, #38a169); }
.result-card.euroexpress::before { background: linear-gradient(90deg, var(--brt-red), var(--brt-red-dark)); }
.result-card.italia::before { background: linear-gradient(90deg, #ecc94b, #d69e2e); }
.result-card.pallet::before { background: linear-gradient(90deg, #9f7aea, #805ad5); }

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.badge {
    background-color: #edf2f7;
    color: #4a5568;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: #718096;
}

.amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--dark-grey);
    letter-spacing: -1px;
}

.result-card.unavailable .amount, .result-card.unavailable .currency {
    color: #cbd5e0;
}

.status-msg {
    font-size: 0.9rem;
    color: #e53e3e;
    min-height: 1.2em;
    margin-top: 0.5rem;
}

.vat-msg {
    font-size: 0.9rem;
    color: #4a5568;
    margin-top: -0.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    body { padding: 1rem; }
    h1 { font-size: 2rem; }
    .calculator-card { padding: 1.5rem; }
}
