/* ================================================================
   reserve.css — 변호사 상담 예약 (Light Enterprise)
   ================================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f7;
    color: #1a1d2e;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.reserve-app {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    background: #ffffff;
    border-left: 1px solid #e8ebf2;
    border-right: 1px solid #e8ebf2;
    padding-bottom: 40px;
}


/* ── Header ──────────────────────────────────── */
.reserve-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid #eceef5;
    position: relative;
}

.reserve-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79,95,229,.15), transparent);
}

.reserve-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #5a6178;
    font-size: 16px;
    text-decoration: none;
    transition: all .2s;
    flex-shrink: 0;
}

.reserve-back:hover {
    background: #f4f5fa;
    color: #4f5fe5;
}

.reserve-header-text h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.reserve-header-text p {
    font-size: 13px;
    color: #8a90a5;
    margin-top: 2px;
}


/* ── Steps ───────────────────────────────────── */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 28px 24px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #e4e7f1;
    background: #fff;
    color: #b0b5c5;
    font-size: 14px;
    font-weight: 700;
    transition: all .3s;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: #b0b5c5;
    transition: color .3s;
}

.step.active .step-num {
    border-color: #4f5fe5;
    background: linear-gradient(145deg, #4f5fe5, #7c6cf0);
    color: #fff;
    box-shadow: 0 3px 10px rgba(79,95,229,.25);
}

.step.active .step-label {
    color: #4f5fe5;
}

.step.done .step-num {
    border-color: #0ea47a;
    background: #0ea47a;
    color: #fff;
}

.step.done .step-label {
    color: #0ea47a;
}

.step-line {
    width: 48px;
    height: 2px;
    background: #e4e7f1;
    margin: 0 8px;
    margin-bottom: 20px;
    border-radius: 1px;
    transition: background .3s;
}

.step-line.active {
    background: #4f5fe5;
}


/* ── Panel ───────────────────────────────────── */
.panel {
    padding: 0 24px;
    animation: fadeUp .35s cubic-bezier(.4,0,.2,1);
}

.panel.hidden { display: none; }

.panel-section {
    margin-bottom: 28px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1d2e;
    margin-bottom: 16px;
}

.panel-title i {
    color: #4f5fe5;
    font-size: 16px;
}


/* ── Calendar (Flatpickr Override) ────────────── */
.flatpickr-calendar {
    font-family: 'Pretendard Variable', 'Pretendard', sans-serif !important;
    background: #fff !important;
}

.flatpickr-calendar.inline {
    width: 100% !important;
    max-width: 100% !important;
    border: 1px solid #eef0f6 !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.03) !important;
    padding: 8px !important;
}

.flatpickr-months {
    padding: 4px 8px !important;
    align-items: center !important;
}

.flatpickr-months .flatpickr-month {
    height: 40px !important;
}

.flatpickr-current-month {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a1d2e !important;
    padding-top: 8px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-weight: 700 !important;
    color: #1a1d2e !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.flatpickr-current-month input.cur-year {
    font-weight: 700 !important;
    color: #1a1d2e !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    padding: 8px !important;
    fill: #5a6178 !important;
    transition: all .15s !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    fill: #4f5fe5 !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    width: 12px !important;
    height: 12px !important;
}

span.flatpickr-weekday {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #8a90a5 !important;
}

.flatpickr-innerContainer {
    padding: 0 4px 4px !important;
}

.flatpickr-days {
    width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

.flatpickr-day {
    max-width: none !important;
    height: 42px !important;
    line-height: 42px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #2e3347 !important;
    border: 2px solid transparent !important;
    transition: all .15s !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #d0d4e0 !important;
}

.flatpickr-day.flatpickr-disabled {
    color: #d0d4e0 !important;
}

.flatpickr-day.today:not(.selected) {
    border-color: #4f5fe5 !important;
    background: transparent !important;
    color: #4f5fe5 !important;
    font-weight: 700 !important;
}

.flatpickr-day:hover:not(.selected):not(.flatpickr-disabled) {
    background: #eef0ff !important;
    border-color: #eef0ff !important;
    color: #4f5fe5 !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: linear-gradient(145deg, #4f5fe5, #7c6cf0) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 10px rgba(79,95,229,.3) !important;
}


/* ── Time Grid ───────────────────────────────── */
.time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.time-slot {
    padding: 12px 0;
    border: 1px solid #e8ebf2;
    border-radius: 10px;
    background: #fafbfe;
    color: #4a5068;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}

.time-slot:hover {
    border-color: #c7ccf9;
    background: #f6f7ff;
    color: #4f5fe5;
}

.time-slot.active {
    background: #4f5fe5;
    color: #fff;
    border-color: #4f5fe5;
    box-shadow: 0 2px 8px rgba(79,95,229,.25);
    font-weight: 700;
}


/* ── Form ────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #3a3f52;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e4e7f1;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1d2e;
    background: #fafbfe;
    outline: none;
    transition: all .2s;
}

.form-input:focus {
    border-color: #4f5fe5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,95,229,.08);
}

.form-input:disabled {
    background: #f4f5fa;
    color: #8a90a5;
}

.form-row {
    display: flex;
    gap: 8px;
}

.form-row .form-input {
    flex: 1;
}

.btn-sms,
.btn-verify {
    flex-shrink: 0;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-sms {
    background: #f4f5fa;
    color: #4f5fe5;
    border: 1px solid #e4e7f1;
}

.btn-sms:hover {
    background: #eef0ff;
}

.btn-sms:disabled {
    opacity: .5;
    cursor: default;
}

.btn-sms.hidden { display: none; }

.btn-verify {
    background: linear-gradient(145deg, #4f5fe5, #7c6cf0);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,95,229,.2);
}

.btn-verify:hover {
    box-shadow: 0 4px 14px rgba(79,95,229,.3);
}

.sms-timer {
    font-size: 12px;
    font-weight: 700;
    color: #e5453d;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.verify-result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(14,164,122,.06);
    border: 1px solid rgba(14,164,122,.15);
    border-radius: 12px;
    color: #0ea47a;
    font-size: 14px;
    font-weight: 600;
    animation: fadeUp .3s;
}

.verify-result.hidden { display: none; }

.verify-result i {
    font-size: 18px;
}


/* ── Buttons ─────────────────────────────────── */
.btn-next {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(145deg, #4f5fe5, #7c6cf0);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s cubic-bezier(.4,0,.2,1);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(79,95,229,.3);
    margin-top: 8px;
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,95,229,.35);
}

.btn-next:disabled {
    background: #e4e7f1;
    color: #b0b5c5;
    box-shadow: none;
    cursor: default;
}

.btn-prev {
    padding: 16px 24px;
    border: 1px solid #e4e7f1;
    border-radius: 14px;
    background: #fff;
    color: #5a6178;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-prev:hover {
    background: #f4f5fa;
    color: #4f5fe5;
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.btn-row .btn-next {
    flex: 1;
}


/* ── Complete ────────────────────────────────── */
.complete-box {
    text-align: center;
    padding: 40px 0;
}

.complete-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: linear-gradient(145deg, #0ea47a, #10b981);
    color: #fff;
    font-size: 32px;
    box-shadow: 0 8px 28px rgba(14,164,122,.25);
}

.complete-box h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.complete-desc {
    font-size: 14px;
    color: #8a90a5;
    margin-bottom: 32px;
}

.complete-info {
    background: #fafbfe;
    border: 1px solid #eef0f6;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 28px;
    text-align: left;
}

.complete-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eef0f6;
}

.complete-row:last-child {
    border-bottom: none;
}

.complete-label {
    font-size: 13px;
    font-weight: 600;
    color: #8a90a5;
}

.complete-value {
    font-size: 14px;
    font-weight: 700;
    color: #1a1d2e;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #f4f5fa;
    border: 1px solid #e4e7f1;
    border-radius: 12px;
    color: #5a6178;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}

.btn-home:hover {
    background: #eef0ff;
    color: #4f5fe5;
}


/* ── Loading Spinner ─────────────────────────── */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ── Animation ───────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Responsive ──────────────────────────────── */
@media (max-width: 640px) {
    .reserve-app { border: none; }
    .time-grid { grid-template-columns: repeat(3, 1fr); }
    .step-line { width: 32px; }
}
