/* ── Offroad Route Planner ── */

#orp-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #1a1a1a;
}

/* ── Form Card ── */
#orp-form-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    margin-bottom: 32px;
}

#orp-form-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #1a3a2a 0%, #2d6a4f 100%);
    color: #fff;
    padding: 24px 28px;
}

#orp-form-header svg {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: #74c69d;
}

#orp-form-header h2 {
    margin: 0 0 4px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    border: none;
    padding: 0;
}

#orp-form-header p {
    margin: 0;
    font-size: .875rem;
    color: #b7e4c7;
}

#orp-form {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.orp-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.orp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}

.orp-field--short {
    flex: 0 0 160px;
    min-width: 140px;
}

.orp-row--middle {
    align-items: flex-end;
}

.orp-field--checkboxes {
    flex: 1;
}

.orp-field-hint {
    font-size: .75rem;
    color: #94a3b8;
    font-style: italic;
    line-height: 1.4;
    margin-top: -12px;
}

.orp-field--checkboxes .orp-checkboxes {
    margin-top: 2px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.orp-field label {
    font-size: .8125rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.orp-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.orp-dot.start { background: #2d6a4f; }
.orp-dot.end   { background: #d62828; }

.orp-field input[type="text"],
.orp-field input[type="number"],
.orp-field textarea {
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .9375rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #f8fafc;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    resize: vertical;
}

.orp-field input:focus,
.orp-field textarea:focus {
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45,106,79,.12);
    background: #fff;
}

/* ── Checkboxes ── */
.orp-checkboxes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.orp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .9375rem;
    font-weight: 500;
    padding: 8px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    transition: all .2s;
    user-select: none;
}

.orp-checkbox-label:hover {
    border-color: #2d6a4f;
    background: #f0faf4;
}

.orp-checkbox-label input[type="checkbox"] {
    display: none;
}

.orp-checkbox-box {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
    background: #fff;
}

.orp-checkbox-box svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    color: #fff;
    transition: opacity .15s;
}

.orp-checkbox-label input:checked ~ .orp-checkbox-box { background: #2d6a4f; border-color: #2d6a4f; }
.orp-checkbox-label input:checked ~ .orp-checkbox-box svg { opacity: 1; }
.orp-checkbox-label input:checked ~ span:last-child { color: #2d6a4f; }

.orp-difficulty-easy:hover     { border-color: #16a34a; background: #f0fdf4; }
.orp-difficulty-moderate:hover { border-color: #ca8a04; background: #fefce8; }
.orp-difficulty-hard:hover     { border-color: #dc2626; background: #fef2f2; }

.orp-difficulty-easy input:checked     ~ .orp-checkbox-box { background: #16a34a; border-color: #16a34a; }
.orp-difficulty-moderate input:checked ~ .orp-checkbox-box { background: #ca8a04; border-color: #ca8a04; }
.orp-difficulty-hard input:checked     ~ .orp-checkbox-box { background: #dc2626; border-color: #dc2626; }

.orp-difficulty-easy input:checked     ~ span:last-child { color: #16a34a; }
.orp-difficulty-moderate input:checked ~ span:last-child { color: #ca8a04; }
.orp-difficulty-hard input:checked     ~ span:last-child { color: #dc2626; }

/* ── Submit Button ── */
#orp-submit {
    background: linear-gradient(135deg, #2d6a4f, #1b4332);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .15s;
    align-self: flex-start;
}

#orp-submit:hover  { opacity: .9; transform: translateY(-1px); }
#orp-submit:active { transform: translateY(0); }
#orp-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

@keyframes orp-spin { to { transform: rotate(360deg); } }
.orp-spin { animation: orp-spin .9s linear infinite; width: 18px; height: 18px; }

/* ── Error ── */
#orp-error {
    background: #fff0f0;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 16px 20px;
    color: #b91c1c;
    margin-bottom: 24px;
    font-weight: 500;
}

/* ── Results ── */
#orp-results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

#orp-route-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a3a2a;
    margin: 0 0 8px;
    border: none;
    padding: 0;
}

#orp-route-summary {
    color: #475569;
    margin: 0 0 12px;
    line-height: 1.6;
}

#orp-route-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.orp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: .8125rem;
    font-weight: 600;
}

.orp-badge--difficulty-Easy     { background: #d1fae5; color: #065f46; }
.orp-badge--difficulty-Moderate { background: #fef3c7; color: #92400e; }
.orp-badge--difficulty-Hard     { background: #fee2e2; color: #991b1b; }
.orp-badge--difficulty-Expert   { background: #ede9fe; color: #4c1d95; }
.orp-badge--miles  { background: #e0f2fe; color: #0c4a6e; }
.orp-badge--days   { background: #f0fdf4; color: #14532d; }

/* ── GPX Button ── */
#orp-gpx-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid #2d6a4f;
    border-radius: 10px;
    color: #2d6a4f;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .2s;
}
#orp-gpx-btn svg { width: 18px; height: 18px; }
#orp-gpx-btn:hover { background: #2d6a4f; color: #fff; }

/* ── Loading banner ── */
#orp-loading-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a4f 100%);
    color: #fff;
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.orp-banner-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.orp-banner-spin {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    animation: orp-spin 1s linear infinite;
    color: #fff;
    opacity: .95;
}

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

/* ── Map ── */
#orp-map-wrap {
    position: relative;
    margin-bottom: 32px;
}

#orp-map {
    height: 480px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: border-radius .2s;
}

#orp-map-wrap.orp-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    margin: 0;
    padding: 0;
    background: #000;
}

#orp-map-wrap.orp-fullscreen #orp-map {
    height: 100%;
    border-radius: 0;
    border: none;
}

#orp-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1001;
    width: 34px;
    height: 34px;
    background: #fff;
    border: 2px solid rgba(0,0,0,.2);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 5px rgba(0,0,0,.25);
    transition: background .15s;
    padding: 0;
}
#orp-fullscreen-btn:hover { background: #f4f4f4; }
#orp-fullscreen-btn svg { width: 16px; height: 16px; color: #333; display: block; }

/* ── Itinerary ── */
#orp-itinerary {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.orp-day-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.orp-day-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0faf4, #e8f5e9);
    border-bottom: 1px solid #d1fae5;
}

.orp-day-number {
    background: #2d6a4f;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.orp-day-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1a3a2a;
}

.orp-day-miles {
    margin-left: auto;
    font-size: .8125rem;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}

.orp-day-body {
    padding: 16px 20px;
}

.orp-day-desc {
    color: #475569;
    line-height: 1.65;
    margin: 0 0 16px;
}

.orp-waypoints {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.orp-waypoint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}

.orp-wp-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.orp-wp-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: .9375rem;
}

.orp-wp-notes {
    font-size: .8125rem;
    color: #64748b;
    margin-top: 2px;
}

.orp-wp-dist {
    margin-left: auto;
    font-size: .75rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    padding-left: 8px;
    flex-shrink: 0;
    font-style: italic;
}

/* ── Data Sources ── */
.orp-sources-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.orp-sources-card h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a3a2a;
}

.orp-sources-card ul {
    padding-left: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #475569;
    font-size: .875rem;
}

.orp-sources-card li { line-height: 1.55; }

.orp-sources-card a {
    color: #2d6a4f;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.orp-sources-card a:hover { color: #1b4332; }
#orp-tips {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

#orp-tips h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a3a2a;
}

#orp-tips-list {
    padding-left: 20px;
    margin: 0 0 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #475569;
}

#orp-tips-list li { line-height: 1.5; }

#orp-season {
    margin: 0;
    font-size: .875rem;
    color: #64748b;
    font-style: italic;
}

.orp-wp-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Leaflet Custom Markers ── */
.orp-marker-start  { background: #2d6a4f; }
.orp-marker-end    { background: #d62828; }
.orp-marker-camp   { background: #7c3aed; }
.orp-marker-fuel   { background: #b45309; }
.orp-marker-wp     { background: #0369a1; }

.orp-marker-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.orp-marker-pin-inner {
    transform: rotate(45deg);
    font-size: 10px;
    color: #fff;
    line-height: 1;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    #orp-form { padding: 20px; }
    .orp-row  { flex-direction: column; }
    .orp-field--short { flex: 1; }
    #orp-map  { height: 300px; }
    #orp-results-header { flex-direction: column; }
    #orp-gpx-btn { width: 100%; justify-content: center; }
}
