:root {
    --primary: #1F2937;
    --primary-light: #374151;
    --accent: #E53935;
    /* Audi/Premium Red Touch */
    --accent-hover: #D32F2F;
    --bg-color: #F3F4F6;
    --card-bg: #FFFFFF;
    --card-bg-glass: rgba(255, 255, 255, 0.9);
    --border-color: #E5E7EB;
    --text-main: #111827;
    --text-muted: #6B7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

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

body {
    background-color: #fdfdfd;
    color: #1a1a1a;
    font-family: 'Nunito Sans', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.04em;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.simulator-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    flex: 1;
    width: 100%;
}

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

.simulator-header h1 {
    font-family: 'Noto Serif JP', serif !important;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #111;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

@media (max-width: 480px) {
    .simulator-header h1 {
        font-size: 1.75rem;
        letter-spacing: 0.05em;
    }
}

.simulator-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.simulator-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .simulator-content {
        flex-direction: row;
        align-items: flex-start;
    }

    .input-section {
        flex: 1.5;
    }

    .result-section {
        flex: 1;
        position: sticky;
        top: 2rem;
    }
}

.input-card,
.result-card {
    background: var(--card-bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.input-card:hover {
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-family: 'Noto Serif JP', serif !important;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    letter-spacing: 0.05em;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1.5rem 0;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.store-flow {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.store-item {
    flex: 1;
}

.store-sub-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.store-arrow {
    align-self: center;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding-top: 1rem;
    /* Offset for the labels above selects */
}

input[type="datetime-local"] {
    padding: 0.6rem 0.5rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.1);
}



#transport-options {
    animation: fadeIn 0.3s ease-out;
    padding: 1.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    margin-top: 0.5rem;
    overflow-x: hidden;
}

.rate-input {
    display: flex;
    align-items: center;
}

.rate-input input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.rate-input .unit {
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-left: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.duration-badge {
    background: var(--bg-color);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    border: 1px dashed var(--border-color);
}

/* Custom Checkbox Toggle */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ensure toggle-control remains flex across all segments */
label.toggle-control {
    display: inline-flex !important;
    width: 100%;
    margin-bottom: 0;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    white-space: normal;
    word-break: break-word;
}

.toggle-control input {
    display: none;
}

.toggle-control .control {
    display: block;
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 12px;
    margin-right: 12px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle-control .control::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-control input:checked+.control {
    background-color: var(--primary);
}

.toggle-control input:checked+.control::after {
    transform: translateX(20px);
}

.toggle-control .label-text small {
    color: var(--text-muted);
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

@media (min-width: 600px) {
    /* Grid layouts removed for vertical consistency */
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Result Section */
.result-card {
    background: linear-gradient(145deg, #1f2937, #111827);
    color: white;
    border: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-header h2 {
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
}

.selected-class span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.main-payment {
    margin-bottom: 2rem;
}

.main-payment .label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.payment-amount {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    color: white;
}

.payment-amount .currency {
    font-size: 1.5rem;
    font-weight: 500;
}

.payment-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.9rem;
}

.detail-row .label {
    color: rgba(255, 255, 255, 0.7);
}

.detail-row .value {
    font-weight: 600;
}

.detail-row.discount .label,
.detail-row.discount .value {
    color: #4ade80;
}

.fee-breakdown {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.calc-formula {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2px;
}

.total-summary {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.total-summary .detail-row .label {
    color: rgba(255, 255, 255, 0.8);
}

.result-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.disclaimer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.action-btn {
    width: 100%;
    padding: 0.875rem;
    background-color: white;
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background-color: var(--bg-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0.5;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-amount,
.detail-row .value {
    animation: fadeIn 0.3s ease-out forwards;
}