/* Smart Courier Manager — Frontend Styles */

/* ── Booking Form ─────────────────────────────────────────────────────── */
.scm-booking-wrap { max-width: 800px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.scm-form-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 24px; margin-bottom: 16px; }
.scm-section-heading { margin: 0 0 20px; font-size: 16px; font-weight: 700; color: #1a202c; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }

.scm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.scm-row--3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 600px) { .scm-row, .scm-row--3 { grid-template-columns: 1fr; } }
.scm-field { margin-bottom: 16px; }
.scm-field:last-child { margin-bottom: 0; }

.scm-form label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.scm-input { display: block; width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; color: #1f2937; background: #fff; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.scm-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.scm-input::placeholder { color: #9ca3af; }
textarea.scm-input { resize: vertical; min-height: 72px; }

.scm-error-msg { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }

.scm-submit-btn { width: 100%; padding: 14px; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background .15s; margin-top: 4px; }
.scm-submit-btn:hover { background: #1d4ed8; }
.scm-submit-btn:disabled { background: #93c5fd; cursor: not-allowed; }

/* ── Success Screen ───────────────────────────────────────────────────── */
.scm-success-area { margin-top: 20px; }
.scm-success-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 40px 32px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.scm-success-icon { font-size: 52px; margin-bottom: 12px; }
.scm-success-box h2 { margin: 0 0 10px; font-size: 24px; color: #1a202c; }
.scm-success-box p { color: #6b7280; margin: 0 0 24px; font-size: 15px; }

.scm-tracking-id-display { background: #eff6ff; border: 2px dashed #3b82f6; border-radius: 8px; padding: 20px; margin-bottom: 24px; }
.scm-success-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #6b7280; margin-bottom: 6px; }
.scm-success-tracking-id { display: block; font-size: 28px; font-weight: 800; color: #2563eb; letter-spacing: 1px; word-break: break-all; }

.scm-success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.scm-btn-copy, .scm-btn-new { padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; border: 2px solid; transition: all .15s; }
.scm-btn-copy { background: transparent; border-color: #2563eb; color: #2563eb; }
.scm-btn-copy:hover { background: #2563eb; color: #fff; }
.scm-btn-new { background: #2563eb; border-color: #2563eb; color: #fff; }
.scm-btn-new:hover { background: #1d4ed8; border-color: #1d4ed8; }
.scm-btn-download { display: inline-block; padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 600; text-decoration: none; background: #059669; border: 2px solid #059669; color: #fff; transition: all .15s; }
.scm-btn-download:hover { background: #047857; border-color: #047857; color: #fff; }

/* ── Tracking Page ────────────────────────────────────────────────────── */
.scm-tracking-wrap { max-width: 680px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.scm-tracking-form { margin-bottom: 28px; }
.scm-tracking-input-row { display: flex; gap: 10px; }
.scm-tracking-input { flex: 1; padding: 12px 16px; border: 2px solid #d1d5db; border-radius: 6px; font-size: 15px; transition: border-color .15s; }
.scm-tracking-input:focus { outline: none; border-color: #2563eb; }
.scm-tracking-btn { padding: 12px 24px; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; }
.scm-tracking-btn:hover { background: #1d4ed8; }

.scm-tracking-not-found { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; padding: 16px 20px; border-radius: 8px; }

.scm-tracking-result { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.06); }

.scm-tracking-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.scm-tracking-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.8); margin-bottom: 4px; }
.scm-tracking-id { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: .5px; }

.scm-status-badge { display: inline-block; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.2); color: #fff; border: 2px solid rgba(255,255,255,.5); }

/* Progress bar */
.scm-progress-bar { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 24px 16px; position: relative; }
.scm-progress-bar::before { content: ''; position: absolute; top: 36px; left: 40px; right: 40px; height: 3px; background: #e2e8f0; z-index: 0; }
.scm-progress-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; z-index: 1; }
.scm-progress-dot { width: 20px; height: 20px; border-radius: 50%; background: #e2e8f0; border: 3px solid #fff; box-shadow: 0 0 0 2px #e2e8f0; }
.scm-progress-step.done .scm-progress-dot { background: #10b981; box-shadow: 0 0 0 2px #10b981; }
.scm-progress-step.active .scm-progress-dot { background: #2563eb; box-shadow: 0 0 0 2px #2563eb; animation: scm-pulse 1.5s infinite; }
.scm-progress-label { font-size: 11px; font-weight: 600; color: #6b7280; text-align: center; }
.scm-progress-step.done .scm-progress-label, .scm-progress-step.active .scm-progress-label { color: #1f2937; }
@keyframes scm-pulse { 0%,100% { box-shadow: 0 0 0 2px #2563eb; } 50% { box-shadow: 0 0 0 5px rgba(37,99,235,.3); } }

/* Details grid */
.scm-tracking-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid #e2e8f0; }
.scm-tracking-col { padding: 16px 20px; border-right: 1px solid #e2e8f0; }
.scm-tracking-col:last-child { border-right: 0; }
.scm-tracking-col h4 { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #6b7280; }
.scm-tracking-col p { margin: 0 0 4px; font-size: 14px; color: #1f2937; }
@media (max-width: 600px) { .scm-tracking-details { grid-template-columns: 1fr; } .scm-tracking-col { border-right: 0; border-bottom: 1px solid #e2e8f0; } }

/* Timeline (PRO) */
.scm-timeline { padding: 20px 24px; border-top: 1px solid #e2e8f0; }
.scm-timeline h4 { margin: 0 0 16px; font-size: 14px; font-weight: 700; color: #374151; }
.scm-timeline-list { list-style: none; margin: 0; padding: 0; }
.scm-timeline-item { display: flex; gap: 14px; margin-bottom: 16px; position: relative; padding-left: 0; }
.scm-timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: #2563eb; margin-top: 4px; flex-shrink: 0; }
.scm-timeline-content strong { display: block; font-size: 14px; color: #1f2937; margin-bottom: 2px; }
.scm-timeline-location { display: inline-block; background: #eff6ff; color: #2563eb; font-size: 12px; padding: 1px 8px; border-radius: 3px; margin-left: 6px; }
.scm-timeline-notes { margin: 4px 0; font-size: 13px; color: #6b7280; }
.scm-timeline-content time { font-size: 12px; color: #9ca3af; }

/* PRO prompt */
.scm-tracking-pro-prompt { padding: 16px 24px; background: #fefce8; border-top: 1px solid #fde68a; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.scm-pro-badge { background: #f59e0b; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; flex-shrink: 0; }
.scm-tracking-pro-prompt a { color: #2563eb; font-weight: 600; margin-left: auto; white-space: nowrap; }

/* ── Cost Estimate ────────────────────────────────────────────────────── */

/* ── Field builder additions ────────────────────────────────────────── */
.scm-field-label { display:block; font-weight:600; font-size:14px; margin-bottom:5px; color:#1d2327; }
.scm-field-desc  { font-size:12px; color:#6b7280; margin:4px 0 0; }
.scm-required    { color:#d63638; margin-left:2px; }
.scm-field--full { margin-bottom:14px; }

.scm-radio-group,
.scm-checkbox-group { display:flex; flex-direction:column; gap:8px; margin-top:4px; }

.scm-radio-label,
.scm-checkbox-label {
    display:flex; align-items:center; gap:8px;
    font-size:14px; cursor:pointer; color:#2c3338;
}
.scm-radio-label input,
.scm-checkbox-label input { width:16px; height:16px; cursor:pointer; accent-color:#2271b1; flex-shrink:0; }

.scm-input[type="date"] { padding:8px 12px; }

/* ── Cost preview (public form) ─────────────────────────────────────── */
.scm-cost-preview {
    background: #f0f6fc;
    border: 1px solid #c3d9f0;
    border-left: 4px solid #2271b1;
    border-radius: 8px;
    padding: 16px 18px;
    margin: 16px 0;
}
.scm-cost-preview-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.scm-cost-label  { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #4b5563; }
.scm-cost-amount { font-size: 28px; font-weight: 900; color: #2271b1; font-family: monospace; }

/* Cost breakdown table */
.scm-cost-breakdown { margin-top: 4px; }
.scm-cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.scm-cost-table thead tr {
    background: rgba(34,113,177,.08);
}
.scm-cost-table th {
    padding: 6px 10px;
    text-align: left;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #c3d9f0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.scm-cost-table th:last-child,
.scm-cost-table td:last-child { text-align: right; }

.scm-rule-row td {
    padding: 7px 10px;
    border-bottom: 1px solid #e5edfa;
    color: #374151;
}
.scm-rule-name    { font-weight: 600; white-space: nowrap; }
.scm-rule-formula { color: #6b7280; font-size: 12px; font-family: monospace; }
.scm-rule-amount  { font-weight: 700; color: #1d2327; white-space: nowrap; }

.scm-rule-total td {
    padding: 8px 10px;
    background: rgba(34,113,177,.06);
    border-top: 2px solid #c3d9f0;
    font-size: 14px;
}
.scm-rule-total .scm-rule-amount { color: #2271b1; font-size: 16px; }

/* ── Delivery Zone Picker ────────────────────────────────────────────── */
.scm-zone-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.scm-zone-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 16px;
    border: 2px solid #dcdcde;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: all .18s ease;
    text-align: center;
    position: relative;
    user-select: none;
}

.scm-zone-card:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.scm-zone-card--active,
.scm-zone-card--inside.scm-zone-card--active {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 3px rgba(34,113,177,.15);
}

.scm-zone-card--outside.scm-zone-card--active {
    border-color: #e67e22;
    background: #fef9f0;
    box-shadow: 0 0 0 3px rgba(230,126,34,.15);
}

.scm-zone-icon {
    font-size: 28px;
    line-height: 1;
}

.scm-zone-label {
    font-size: 14px;
    font-weight: 700;
    color: #1d2327;
}

.scm-zone-card--inside.scm-zone-card--active .scm-zone-label { color: #2271b1; }
.scm-zone-card--outside.scm-zone-card--active .scm-zone-label { color: #e67e22; }

.scm-zone-sub {
    font-size: 11px;
    color: #646970;
    line-height: 1.4;
}

/* selected tick */
.scm-zone-card--active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #2271b1;
}
.scm-zone-card--outside.scm-zone-card--active::after {
    color: #e67e22;
}

@media (max-width: 480px) {
    .scm-zone-picker { grid-template-columns: 1fr; }
}

/* ── Delivery Zone Picker ─────────────────────────────────────────────── */
.scm-zone-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}
.scm-zone-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 14px 16px;
    border: 2px solid #dcdcde;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color .18s, background .18s, box-shadow .18s;
    text-align: center;
    user-select: none;
}
.scm-zone-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.scm-zone-card:hover {
    border-color: #aac7e0;
    background: #f8fbff;
}
.scm-zone-icon {
    font-size: 32px;
    line-height: 1;
}
.scm-zone-main {
    font-size: 14px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.3;
}
.scm-zone-rate {
    font-size: 13px;
    font-weight: 700;
    color: #646970;
    background: #f0f0f1;
    border-radius: 20px;
    padding: 2px 10px;
    margin-top: 2px;
}
/* Inside City — active */
.scm-zone-card--inside.scm-zone-card--active {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 3px rgba(34,113,177,.15);
}
.scm-zone-card--inside.scm-zone-card--active .scm-zone-main { color: #2271b1; }
.scm-zone-card--inside.scm-zone-card--active .scm-zone-rate {
    background: #2271b1;
    color: #fff;
}
/* Outside City — active */
.scm-zone-card--outside.scm-zone-card--active {
    border-color: #e67e22;
    background: #fff9f2;
    box-shadow: 0 0 0 3px rgba(230,126,34,.15);
}
.scm-zone-card--outside.scm-zone-card--active .scm-zone-main { color: #c0620e; }
.scm-zone-card--outside.scm-zone-card--active .scm-zone-rate {
    background: #e67e22;
    color: #fff;
}
/* Checkmark badge */
.scm-zone-card--active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 13px;
    font-weight: 800;
}
.scm-zone-card--inside.scm-zone-card--active::after  { color: #2271b1; }
.scm-zone-card--outside.scm-zone-card--active::after { color: #e67e22; }

@media (max-width: 520px) {
    .scm-zone-picker { grid-template-columns: 1fr; }
}

/* ── Utility ────────────────────────────────────────────────────────── */
.scm-hidden { display: none !important; }
