/* ================================================================
   Data Collection Scheduler — Styles
   ================================================================ */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}
header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}
.subtitle {
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Steps */
.step {
    display: none;
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.step.active {
    display: block;
}
.step h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.selected-info {
    font-size: 0.95rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

/* Calendar */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1rem;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    padding: 0.25rem 0;
    text-transform: uppercase;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: default;
    color: var(--gray-300);
    border: 2px solid transparent;
    transition: all 0.15s;
}

.cal-day.available {
    color: var(--gray-800);
    cursor: pointer;
    background: var(--gray-50);
    font-weight: 500;
}
.cal-day.available:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.cal-day.today {
    border-color: var(--gray-300);
}
.cal-day.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.cal-day.has-bookings {
    position: relative;
}
.cal-day.has-bookings::after {
    content: "";
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--danger);
}
.cal-day.selected.has-bookings::after {
    background: #fff;
}

/* Timeline */
.timeline-container {
    margin-bottom: 1.25rem;
}
.timeline {
    display: flex;
    height: 48px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    position: relative;
}
.timeline-slot {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}
.timeline-slot.booked {
    background: var(--danger);
    opacity: 0.75;
}
.timeline-slot.selected {
    background: var(--primary);
    opacity: 0.85;
}
.timeline-hours {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 2px;
    padding: 0 2px;
}

/* Time controls */
.time-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.control-group {
    flex: 1;
    min-width: 120px;
}
.control-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.control-group select,
.control-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--gray-800);
    background: #fff;
    appearance: auto;
}
.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.end-time {
    display: block;
    padding: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Slot summary */
.slot-summary {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--primary-hover);
}
.slot-summary.error {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}
.form-group input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--gray-800);
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}
.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-200);
}
.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

/* Confirmation */
.confirmation {
    text-align: center;
    padding: 1rem 0;
}
.check-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.confirmation h2 {
    text-align: center;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}
.confirmation p {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}
.confirm-email {
    font-size: 0.9rem;
    color: var(--gray-400) !important;
    margin-bottom: 1.5rem !important;
}

/* Loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    margin-left: 0.5rem;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .container { padding: 1rem; }
    header h1 { font-size: 1.35rem; }
    .time-controls { flex-direction: column; gap: 0.75rem; }
}
