@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
    /* Design System N46 Style - ComptaX */
    --ink: #0c0c0e;
    --surface: #141417;
    --surface2: #1c1c21;
    --line: #26262c;
    --fg: #ececf1;
    --dim: #8b8b96;
    --faint: #55555e;

    /* Accent colors */
    --amber: #ffb300;
    --amber-dim: rgba(255, 179, 0, 0.15);
    --good: #4cd97b;
    --good-dim: rgba(76, 217, 123, 0.15);
    --bad: #ff5c5c;
    --bad-dim: rgba(255, 92, 92, 0.15);

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
}

html {
    background: var(--ink);
}

body {
    font-family: 'Sora', system-ui, sans-serif;
    background: radial-gradient(1200px 500px at 50% -200px, rgba(255, 179, 0, 0.07), transparent 60%), var(--ink);
    color: var(--fg);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px;
    padding-bottom: 100px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0 20px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--fg);
}

.header h1 span {
    color: var(--amber);
}

.header p {
    color: var(--dim);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
}

.card h2 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--fg);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
    min-height: 48px;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 179, 0, 0.6);
}

.form-group input::placeholder {
    color: var(--faint);
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    min-height: 48px;
}

.btn-primary {
    background: var(--amber);
    color: var(--ink);
}

.btn-primary:hover {
    background: #ffc107;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-call {
    background: var(--good);
    color: var(--ink);
    margin-top: 16px;
}

.btn-call:hover {
    background: #5de88a;
}

/* Distance result */
.result-card {
    text-align: center;
}

.distance-result {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--amber);
    margin: 10px 0;
    font-variant-numeric: tabular-nums;
}

.duration {
    color: var(--dim);
    font-size: 0.9rem;
}

/* Prestations */
.prestations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prestation-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--line);
    min-height: 48px;
}

.prestation-item:hover {
    background: var(--line);
}

.prestation-item.selected {
    border-color: var(--good);
    background: var(--good-dim);
}

.prestation-item input {
    display: none;
}

.prestation-item .check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--line);
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.prestation-item.selected .check {
    background: var(--good);
    border-color: var(--good);
}

.prestation-item.selected .check::after {
    content: '✓';
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.prestation-info {
    flex: 1;
}

.prestation-info .nom {
    font-weight: 600;
    font-size: 0.95rem;
}

.prestation-info .prix {
    font-family: 'JetBrains Mono', monospace;
    color: var(--amber);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 2px;
}

/* Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    cursor: pointer;
    min-height: 48px;
}

.option-item input {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: var(--amber);
}

/* Devis */
.devis-card {
    border: 1px solid var(--amber);
}

.devis-details {
    margin-bottom: 20px;
}

.devis-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.devis-line:last-child {
    border-bottom: none;
}

.devis-line .label {
    color: var(--dim);
    font-size: 0.9rem;
}

.devis-line .value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.9rem;
}

.devis-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--amber);
    border-radius: var(--radius-lg);
    color: var(--ink);
    font-weight: 700;
}

.devis-total span:last-child {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--dim);
    font-size: 0.8rem;
}

.footer a {
    color: var(--amber);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--line);
    border-radius: 50%;
    border-top-color: var(--ink);
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
    color: var(--fg);
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--surface2);
}

.autocomplete-item .main-text {
    font-weight: 500;
}

.autocomplete-item .sub-text {
    font-size: 0.8rem;
    color: var(--dim);
    margin-top: 2px;
}

.autocomplete-loading {
    padding: 12px 16px;
    color: var(--dim);
    font-size: 0.9rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 400px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .distance-result {
        font-size: 2rem;
    }
}
