/* Variables & Reset */
:root {
    --vg-primary: #4f46e5;
    /* Indigo 600 */
    --vg-primary-hover: #4338ca;
    /* Indigo 700 */
    --vg-secondary: #10b981;
    /* Emerald 500 */
    --vg-accent: #f59e0b;
    /* Amber 500 */
    --vg-bg: #f3f4f6;
    /* Gray 100 */
    --vg-card-bg: #ffffff;
    --vg-text: #1f2937;
    /* Gray 800 */
    --vg-text-light: #6b7280;
    /* Gray 500 */
    --vg-border: #e5e7eb;
    /* Gray 200 */
    --vg-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --vg-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --vg-radius: 12px;
    --vg-transition: all 0.3s ease;
}
.vg-totalcost-wrapper {
    max-width: 900px;
    margin: 40px auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--vg-card-bg);
    padding: 40px;
    border-radius: var(--vg-radius);
    box-shadow: var(--vg-shadow-lg);
    color: var(--vg-text);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.vg-totalcost-wrapper * {
    box-sizing: border-box;
}
/* Header */
.vg-totalcost-header {
    text-align: center;
    margin-bottom: 40px;
}
.vg-totalcost-header h2 {
    font-size: 2rem;
    color: var(--vg-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.vg-totalcost-header p {
    color: var(--vg-text-light);
    font-size: 1.1rem;
}
/* Sections */
.vg-totalcost-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8fafc;
    border-radius: var(--vg-radius);
    border: 1px solid var(--vg-border);
    transition: var(--vg-transition);
}
.vg-totalcost-section:hover {
    box-shadow: var(--vg-shadow);
    border-color: #d1d5db;
}
.vg-totalcost-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.25rem;
    color: var(--vg-text);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--vg-border);
    padding-bottom: 10px;
}
.vg-totalcost-section h3 i {
    color: var(--vg-primary);
}
/* Grid */
.vg-totalcost-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
/* Fields */
.vg-totalcost-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--vg-text);
}
.vg-input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.vg-input-icon-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--vg-text-light);
    pointer-events: none;
    z-index: 1;
}
.vg-totalcost-field input,
.vg-totalcost-field select {
    width: 100%;
    padding: 12px 12px 12px 40px;
    /* Space for icon */
    border: 2px solid var(--vg-border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: var(--vg-transition);
    color: var(--vg-text);
}
.vg-totalcost-field input:focus,
.vg-totalcost-field select:focus {
    border-color: var(--vg-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}
/* Radio Group */
.vg-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.vg-radio-box {
    flex: 1;
    position: relative;
    cursor: pointer;
}
.vg-radio-box input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.vg-radio-box span {
    display: block;
    padding: 10px 15px;
    background: #fff;
    border: 2px solid var(--vg-border);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: var(--vg-text-light);
    transition: var(--vg-transition);
}
.vg-radio-box input:checked+span {
    background: var(--vg-primary);
    color: #fff;
    border-color: var(--vg-primary);
    box-shadow: var(--vg-shadow);
}
/* Checkbox */
.vg-checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}
.vg-checkbox-container input {
    width: 20px;
    height: 20px;
    accent-color: var(--vg-primary);
}
/* Buttons */
.vg-totalcost-actions {
    text-align: center;
    margin-top: 30px;
}
.vg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--vg-transition);
    box-shadow: var(--vg-shadow);
}
.vg-btn-primary {
    background: linear-gradient(135deg, var(--vg-primary), var(--vg-primary-hover));
    color: #fff;
}
.vg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--vg-shadow-lg);
    background: linear-gradient(135deg, var(--vg-primary-hover), var(--vg-primary));
}
.vg-btn-secondary {
    background: #fff;
    color: var(--vg-text);
    border: 2px solid var(--vg-border);
    font-size: 0.9rem;
    padding: 10px 20px;
}
.vg-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}
/* Results Area */
.vg-totalcost-results {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px dashed var(--vg-border);
    animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.vg-results-header h3 {
    text-align: center;
    color: var(--vg-text);
    margin-bottom: 30px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.vg-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.vg-result-card {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--vg-shadow);
    border: 1px solid var(--vg-border);
    transition: var(--vg-transition);
    position: relative;
    overflow: hidden;
}
.vg-result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--vg-shadow-lg);
}
.vg-card-icon {
    font-size: 2rem;
    color: var(--vg-primary);
    margin-bottom: 15px;
    opacity: 0.8;
}
.vg-result-card h4 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--vg-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.vg-result-card .vg-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--vg-text);
    word-break: break-word;
}
/* Grand Total Card */
.vg-result-card.vg-grand-total {
    background: linear-gradient(135deg, var(--vg-primary), var(--vg-primary-hover));
    color: #fff;
    border: none;
    grid-column: 1 / -1;
    /* Span full width on mobile if needed, or just stand out */
}
@media (min-width: 768px) {
    .vg-result-card.vg-grand-total {
        grid-column: auto;
        /* Reset on larger screens if grid fits */
    }
}
.vg-result-card.vg-grand-total .vg-card-icon,
.vg-result-card.vg-grand-total h4,
.vg-result-card.vg-grand-total .vg-amount {
    color: #fff;
}
.vg-result-card.vg-grand-total .vg-card-icon {
    color: rgba(255, 255, 255, 0.8);
}
/* Breakdown */
.vg-breakdown {
    background: #f0fdf4;
    /* Light green bg */
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    margin-bottom: 30px;
}
.vg-breakdown p {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    color: #166534;
    /* Dark green text */
}
.vg-breakdown p span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Print */
@media print {
    .vg-totalcost-wrapper {
        box-shadow: none;
        border: none;
        width: 100%;
        max-width: 100%;
    }
    .vg-totalcost-form,
    .vg-result-actions,
    .vg-totalcost-header p {
        display: none;
    }
    .vg-totalcost-results {
        display: block !important;
        border: none;
        animation: none;
    }
    .vg-result-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    .vg-result-card.vg-grand-total {
        background: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }
    .vg-result-card.vg-grand-total * {
        color: #000 !important;
    }
}