/* assets/gar.css */

.gar-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.gar-calculator-root {
    background: #ffffff;
    border: 1px solid #083141;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Header */

.gar-header {
    margin-bottom: 1.5rem;
}

.gar-title {
    margin: 0 0 0.3rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #083141;
}

.gar-intro {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #334155;
}

.gar-note {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

/* Steps */

.gar-step {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.gar-step__title {
    margin: 0 0 0.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #083141;
}

.gar-step__help {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Grid */

.gar-grid {
    display: grid;
    gap: 0.9rem;
}

.gar-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gar-grid--stack {
    align-items: flex-start;
}

@media (max-width: 720px) {
    .gar-grid--2 {
        grid-template-columns: 1fr;
    }
}

/* Fields */

.gar-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gar-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.gar-input,
.gar-input-prefix input {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    background: #f9fafb;
    color: #111827;
}

.gar-input:focus,
.gar-input-prefix input:focus {
    outline: 2px solid #083141;
    outline-offset: 0;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(8, 49, 65, 0.15);
}

.gar-input-prefix {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.gar-input-prefix__symbol {
    font-size: 0.9rem;
    color: #6b7280;
}

.gar-help {
    font-size: 0.78rem;
    color: #6b7280;
}

.gar-error {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.2rem;
    display: none;
}

.gar-error--show {
    display: block;
}

.gar-input--error,
.gar-input-prefix input.gar-input--error {
    border-color: #dc2626;
    background: #fef2f2;
}

/* Summary Cards */

.gar-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.gar-summary--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .gar-summary--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .gar-summary {
        grid-template-columns: 1fr;
    }
}

.gar-summary-card {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.gar-summary-card--neutral {
    background: #f9fafb;
}

.gar-summary-card--positive {
    background: #ecfdf3;
    border-color: #4ade80;
}

.gar-summary-card--cash {
    background: #eff6ff;
    border-color: #60a5fa;
}

.gar-summary-card--benefit {
    background: #f0fdf4;
    border-color: #4ade80;
}

.gar-summary-card--negative {
    background: #fef2f2;
    border-color: #fca5a5;
}

.gar-summary-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 0.1rem;
}

.gar-summary-main {
    font-weight: 700;
    font-size: 1.1rem;
    color: #111827;
}

.gar-summary-sub {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
}

/* Panels */

.gar-panel {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0.9rem 1rem;
}

.gar-panel__title {
    margin: 0 0 0.25rem;
    font-size: 0.96rem;
    font-weight: 600;
    color: #083141;
}

.gar-panel__body {
    margin: 0;
    font-size: 0.9rem;
    color: #374151;
}

.gar-panel__meta {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Highlight Badge */

.gar-highlight-badge {
    margin-top: 0.9rem;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid transparent;
}

.gar-highlight-badge--positive {
    background: #ecfdf3;
    color: #166534;
    border-color: #4ade80;
}

.gar-highlight-badge--fire {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 2px solid #f59e0b;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    animation: gar-pulse 2s ease-in-out infinite;
}

@keyframes gar-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    }
    50% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    }
}

.gar-highlight-badge--negative {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.gar-highlight-badge--neutral {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #93c5fd;
}

/* Map Layout */

.gar-layout {
    margin-top: 0.5rem;
}

.gar-layout-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .gar-layout-row {
        grid-template-columns: 1fr;
    }
}

.gar-layout-main {
    min-width: 0;
}

.gar-layout-side {
    min-width: 0;
}

/* Move Summary */

.gar-move-summary {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 1rem;
}

.gar-move-summary__title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #083141;
}

.gar-move-summary__text {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.gar-move-summary__route {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gar-move-summary__location {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.gar-move-summary__location-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.gar-move-summary__location-details {
    flex: 1;
    min-width: 0;
}

.gar-move-summary__location-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.gar-move-summary__location-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #083141;
    margin-bottom: 0.25rem;
}

.gar-move-summary__location-price {
    font-size: 0.85rem;
    color: #4b5563;
    font-weight: 500;
}

.gar-move-summary__location--from .gar-move-summary__location-icon {
    color: #f97316;
}

.gar-move-summary__location--to .gar-move-summary__location-icon {
    color: #22c55e;
}

.gar-move-summary__arrow {
    font-size: 1.5rem;
    color: #9ca3af;
    text-align: center;
    margin: -0.25rem 0;
    flex-shrink: 0;
}

.gar-move-summary__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.gar-move-summary__stat {
    text-align: center;
}

.gar-move-summary__stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.gar-move-summary__stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #083141;
}

/* Preset Buttons */

.gar-presets {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gar-preset-btn {
    padding: 0.5rem 1rem;
    background: #f0f4f8;
    border: 1.5px solid #083141;
    border-radius: 8px;
    color: #083141;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(8, 49, 65, 0.1);
}

.gar-preset-btn:hover {
    background: #083141;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(8, 49, 65, 0.2);
    transform: translateY(-1px);
}

.gar-preset-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(8, 49, 65, 0.1);
}

/* Chips */

.gar-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 500;
}

.gar-chip--muted {
    background: #eef2ff;
    color: #1e40af;
    border: 1px solid #c7d2fe;
}

/* Stamp duty field alignment */

.gar-field--stamp .gar-chip {
    margin-top: 0.3rem;
}

/* Accessibility tweaks */

.gar-input::-webkit-outer-spin-button,
.gar-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gar-input[type="number"] {
    -moz-appearance: textfield;
}

/* Cost Breakdown */

.gar-cost-breakdown {
    margin-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.gar-cost-breakdown__title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #083141;
}

.gar-cost-breakdown__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gar-cost-breakdown__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.gar-cost-breakdown__label {
    color: #374151;
    font-weight: 500;
}

.gar-cost-breakdown__value {
    color: #111827;
    font-weight: 600;
}

.gar-cost-breakdown__total {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid #083141;
    font-weight: 700;
    font-size: 1rem;
}

.gar-cost-breakdown__total .gar-cost-breakdown__value {
    color: #083141;
    font-size: 1.1rem;
}

/* Reset Button */

.gar-reset-btn {
    margin-top: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: #f9fafb;
    border: 1px solid #083141;
    border-radius: 8px;
    color: #083141;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.gar-reset-btn:hover {
    background: #083141;
    color: #ffffff;
}

.gar-reset-btn:active {
    transform: translateY(1px);
}

/* Projection Table */

.gar-projection-table {
    margin-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.gar-projection-table__title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #083141;
}

.gar-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.gar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.gar-table thead {
    background: #ebf2f4;
    display: table-header-group;
}

.gar-table thead tr {
    display: table-row;
}

.gar-table th,
.gar-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
    display: table-cell;
}

.gar-table th {
    font-weight: 600;
    color: #083141;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.gar-table th:first-child,
.gar-table td:first-child {
    text-align: left;
}

.gar-table__help-row {
    background: #fefce8;
    border-top: 1px solid #eab308;
}

.gar-table__help-cell {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #083141;
    font-weight: 500;
    text-align: left;
    border-bottom: 2px solid #eab308;
}

.gar-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.gar-table tbody tr:hover {
    background: #f0f4f8;
}

.gar-table__highlight {
    font-weight: 700;
    color: #083141;
    background: #f0f9ff;
}

.gar-table__fire-badge {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}


/* Chart Section */

.gar-chart-section {
    margin-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.gar-chart-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    margin-top: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;
    box-sizing: border-box;
    overflow: hidden;
}

.gar-chart-canvas {
    width: 100%;
    height: 100%;
    max-width: 100%;
    display: block;
}

.gar-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.gar-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gar-chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Sensitivity Analysis */

.gar-sensitivity-reset {
    margin-top: 0.75rem;
}

/* Assumptions & Disclaimer */

.gar-assumptions {
    margin-top: 0.5rem;
}

.gar-assumptions-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #083141;
}

.gar-assumptions-list {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
    list-style: none;
}

.gar-assumptions-list li {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #374151;
    position: relative;
    padding-left: 0.5rem;
}

.gar-assumptions-list li::before {
    content: '•';
    position: absolute;
    left: -1rem;
    color: #083141;
    font-weight: 700;
}

.gar-disclaimer {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(220, 53, 69, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.gar-disclaimer-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #b91c1c;
}

.gar-disclaimer-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #721c24;
}

/* Print */

@media print {
    .gar-wrapper {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .gar-calculator-root {
        box-shadow: none;
        border-radius: 0;
        border: none;
        padding: 0;
    }

    .gar-layout-row {
        grid-template-columns: 2fr 1fr;
    }
}