/* ================================================
   Rogis Taxi Boeker – form.css v2.0
   ================================================ */

/* ── CSS Custom properties & reset ── */
.rogis-taxi-form {
    --primary:     #ffcc00;
    --primary-d:   #e6b800;
    --dark:        #0d1b2a;
    --blue:        #0073e6;
    --border:      #e2e8f0;
    --radius:      10px;
    --shadow:      0 8px 32px rgba(0,0,0,.1);
    --text:        #1a202c;
    --muted:       #718096;
    --success-bg:  #f0fff4;
    --success-txt: #276749;
    --error-bg:    #fff5f5;
    --error-txt:   #c53030;

    width: 100%;
    max-width: 860px;
    margin: 24px auto;
    padding: 28px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--text);
    box-sizing: border-box;
    position: relative;
}

/* ── Progress bar ── */
.rtf-progress {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    gap: 0;
}
.rtf-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
}
.rtf-ps-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #aaa;
    font-weight: 700;
    font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
    transition: background .3s, color .3s, transform .2s;
    border: 2px solid #e2e8f0;
}
.rtf-ps-label {
    font-size: .72rem;
    color: #aaa;
    font-weight: 600;
    white-space: nowrap;
    transition: color .3s;
}
.rtf-progress-step.active  .rtf-ps-circle  { background: var(--primary); color: var(--dark); border-color: var(--primary); transform: scale(1.1); }
.rtf-progress-step.active  .rtf-ps-label   { color: var(--dark); }
.rtf-progress-step.done    .rtf-ps-circle  { background: var(--primary-d); color: var(--dark); border-color: var(--primary-d); }
.rtf-progress-step.done    .rtf-ps-circle::after { content: '✓'; }
.rtf-progress-step.done    .rtf-ps-circle  { font-size: 0; }
.rtf-progress-step.done    .rtf-ps-circle::after { font-size: .9rem; }

.rtf-progress-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    margin: 0 6px;
    margin-bottom: 20px; /* align with circles */
    transition: background .3s;
    border-radius: 3px;
}
.rtf-progress-line.active { background: var(--primary); }

/* ── Steps ── */
.taxi-step       { display: none; animation: rtf-fade .25s ease; }
.taxi-step.active{ display: block; }
@keyframes rtf-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Headings ── */
.taxi-step h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 20px;
}
.step-icon { font-size: 1.2rem; }

/* ── Form grid ── */
.rtf-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.rtf-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rtf-field  { display: flex; flex-direction: column; gap: 5px; }

/* ── Labels ── */
.rtf-field label {
    font-size: .85rem;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 4px;
}
.req      { color: #e53e3e; font-size: .8rem; }
.optional { font-size: .75rem; color: var(--muted); font-weight: 400; }

/* ── Inputs ── */
.taxi-step input:not([type="number"]):not([type="hidden"]),
.taxi-step select,
.taxi-step textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    background: #f8fafc;
    color: var(--text);
    transition: border .2s, box-shadow .2s, background .2s;
    box-sizing: border-box;
    font-family: inherit;
}
.taxi-step input:focus,
.taxi-step select:focus,
.taxi-step textarea:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,204,0,.18);
}
.taxi-step input.rtf-invalid { border-color: #fc8181; background: #fff5f5; }
.rtf-field-error { font-size: .78rem; color: var(--error-txt); margin-top: 2px; }
.taxi-step textarea { resize: vertical; min-height: 80px; }

/* ── Ride info cards ── */
.rtf-ride-info {
    display: flex;
    gap: 12px;
    margin: 14px 0;
    flex-wrap: wrap;
}
.rtf-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f7ff;
    border: 1px solid #bee3f8;
    border-radius: var(--radius);
    padding: 10px 14px;
    flex: 1;
    min-width: 140px;
}
.rtf-info-icon { font-size: 1.2rem; }
.rtf-info-card strong { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.rtf-info-card span   { font-size: .9rem; font-weight: 700; color: var(--blue); }
.rtf-info-loader { font-size: .85rem; color: var(--muted); align-self: center; }

/* ── Toggle switches ── */
.rtf-toggles-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin: 14px 0;
}
.rtf-toggle-group, .rtf-passengers-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rtf-toggle-group label, .rtf-passengers-group label {
    font-size: .85rem;
    font-weight: 600;
    color: #4a5568;
}
.rtf-return-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0;
}
.rtf-return-row label { margin: 0; font-size: .85rem; font-weight: 600; color: #4a5568; }

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 110px;
    height: 38px;
    border-radius: 38px;
    background: #edf2f7;
    cursor: pointer;
    padding: 3px;
    box-sizing: border-box;
    user-select: none;
    transition: background .25s;
    border: 1.5px solid var(--border);
}
.toggle-switch span {
    flex: 1;
    text-align: center;
    font-size: .78rem;
    font-weight: 600;
    color: #718096;
    z-index: 2;
    pointer-events: none;
    transition: color .2s;
    line-height: 1;
}
.toggle-switch .slider {
    position: absolute;
    top: 3px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    z-index: 1;
    transition: left .22s cubic-bezier(.4,0,.2,1);
}
.toggle-switch.active-left  .slider { left: 3px; }
.toggle-switch.active-right .slider { left: calc(100% - 39px); }
.toggle-switch.active-left  span:first-child { color: var(--dark); font-weight: 700; }
.toggle-switch.active-right span:last-child  { color: var(--dark); font-weight: 700; }

/* ── Counters ── */
.passengers-counter, .bagage-counter {
    display: flex;
    align-items: center;
    gap: 6px;
}
.passengers-counter input,
.bagage-counter input {
    width: 52px;
    text-align: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 4px;
    font-size: .95rem;
    font-weight: 600;
    background: #fff;
    -moz-appearance: textfield;
}
.passengers-counter input::-webkit-outer-spin-button,
.passengers-counter input::-webkit-inner-spin-button,
.bagage-counter input::-webkit-outer-spin-button,
.bagage-counter input::-webkit-inner-spin-button { -webkit-appearance: none; }
.passengers-counter button,
.bagage-counter button {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--dark);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .1s;
    line-height: 1;
}
.passengers-counter button:hover,
.bagage-counter button:hover { background: var(--primary); color: var(--dark); }
.passengers-counter button:active,
.bagage-counter button:active { transform: scale(.94); }

/* ── Return fields ── */
.return-fields {
    background: #f8fafc;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 10px 0;
}

/* ── Bagage grid ── */
.rtf-bagage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 8px 0 20px;
}
.rtf-bagage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 20px 12px;
    gap: 6px;
    transition: border-color .2s;
}
.rtf-bagage-item:hover { border-color: var(--primary); }
.rtf-bagage-icon { font-size: 2rem; margin-bottom: 4px; }
.rtf-bagage-item strong { font-size: .9rem; color: var(--dark); }
.rtf-bagage-item small  { font-size: .75rem; color: var(--muted); margin-bottom: 8px; }

/* ── Business fields ── */
.business-fields {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .35s ease, opacity .3s ease, margin .3s;
    margin-bottom: 0;
}
.business-fields.active {
    max-height: 500px;
    opacity: 1;
    margin-bottom: 16px;
}

/* ── Navigation buttons ── */
.rtf-nav-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.taxi-nav-btn {
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    background: var(--primary);
    color: var(--dark);
    transition: background .2s, transform .1s, box-shadow .2s;
    letter-spacing: .02em;
}
.taxi-nav-btn:hover  { background: var(--primary-d); box-shadow: 0 4px 12px rgba(255,204,0,.35); }
.taxi-nav-btn:active { transform: scale(.97); }
.taxi-nav-btn.prev-step { background: #edf2f7; color: #4a5568; }
.taxi-nav-btn.prev-step:hover { background: #e2e8f0; box-shadow: none; }
.taxi-nav-btn.submit-taxi { background: var(--dark); color: #fff; }
.taxi-nav-btn.submit-taxi:hover { background: #1a2e45; box-shadow: 0 4px 14px rgba(13,27,42,.3); }
.taxi-nav-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Step 4: Samenvatting ── */
.rtf-confirm-intro { color: var(--muted); font-size: .9rem; margin: 0 0 16px; }
.rtf-summary { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.rtf-summary-section {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.rtf-summary-title {
    background: var(--dark);
    color: #fff;
    padding: 10px 16px;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .03em;
}
.rtf-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.rtf-summary-table tr:nth-child(even) { background: #f8fafc; }
.rtf-summary-table th {
    padding: 9px 14px;
    color: var(--muted);
    font-weight: 600;
    text-align: left;
    width: 40%;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}
.rtf-summary-table td {
    padding: 9px 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    word-break: break-word;
}
.rtf-summary-table tr:last-child th,
.rtf-summary-table tr:last-child td { border-bottom: none; }

/* ── Flatpickr overrides ── */
#taxi-date-time,
#taxi-return-date-time { cursor: pointer; }

/* ── Feedback ── */
.form-response {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    display: none;
}
.form-response.success { background: var(--success-bg); color: var(--success-txt); border: 1.5px solid #9ae6b4; }
.form-response.error   { background: var(--error-bg);   color: var(--error-txt);   border: 1.5px solid #feb2b2; }

/* ── Map ── */
#map { width: 100%; height: 280px; margin-top: 16px; border-radius: var(--radius); overflow: hidden; display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .rogis-taxi-form { padding: 18px; margin: 12px; }
    .rtf-grid-2,
    .rtf-grid-3  { grid-template-columns: 1fr; }
    .rtf-bagage-grid { grid-template-columns: 1fr; }
    .rtf-toggles-row { gap: 12px; }
    .rtf-ps-label    { display: none; }
    .rtf-summary-table th,
    .rtf-summary-table td { display: block; width: 100%; box-sizing: border-box; }
    .rtf-summary-table th { background: #f1f5f9; border-bottom: none; }
    .rtf-summary-table td { border-bottom: 1px solid var(--border); padding-top: 4px; }
}
@media (max-width: 480px) {
    .toggle-switch { width: 96px; }
    .toggle-switch.active-right .slider { left: calc(100% - 39px); }
    .rtf-nav-row .taxi-nav-btn { flex: 1; text-align: center; justify-content: center; }
}
