/* ==========================================================================
   Hamza Booking — Frontend Styles
   ========================================================================== */

:root {
    --hb-primary:       #1e3a5f;
    --hb-primary-light: #e8f0fe;
    --hb-primary-hover: #2980b9;
    --hb-accent:        #27ae60;
    --hb-danger:        #c0392b;
    --hb-warning:       #f39c12;
    --hb-text:          #333333;
    --hb-text-light:    #777777;
    --hb-bg:            #ffffff;
    --hb-border:        #e0e0e0;
    --hb-radius:        8px;
    --hb-shadow:        0 2px 12px rgba(0,0,0,.08);
}

/* ── Container ──────────────────────────────────────────────────────── */

.hamza-booking {
    max-width: 640px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--hb-text);
}

/* ── Progress Indicator ─────────────────────────────────────────────── */

.hamza-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
}

.hamza-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.hamza-progress__dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hb-border);
    color: var(--hb-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: background .3s, color .3s;
}

.hamza-progress__step--active .hamza-progress__dot,
.hamza-progress__step--done .hamza-progress__dot {
    background: var(--hb-primary);
    color: #fff;
}

.hamza-progress__step--done .hamza-progress__dot {
    background: var(--hb-accent);
}

.hamza-progress__label {
    font-size: 12px;
    color: var(--hb-text-light);
    white-space: nowrap;
}

.hamza-progress__step--active .hamza-progress__label {
    color: var(--hb-primary);
    font-weight: 600;
}

.hamza-progress__line {
    flex: 1;
    height: 3px;
    background: var(--hb-border);
    min-width: 30px;
    margin: 0 8px;
    margin-bottom: 22px;
    border-radius: 2px;
    transition: background .3s;
}

.hamza-progress__line--done {
    background: var(--hb-accent);
}

/* ── Steps ──────────────────────────────────────────────────────────── */

.hamza-step {
    animation: hamzaFadeIn .35s ease;
}

.hamza-step__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--hb-primary);
}

.hamza-step__subtitle {
    font-size: 14px;
    color: var(--hb-text-light);
    margin: 0 0 16px;
}

.hamza-step__actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

@keyframes hamzaFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Calendar ───────────────────────────────────────────────────────── */

.hamza-calendar {
    background: var(--hb-bg);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    overflow: hidden;
    box-shadow: var(--hb-shadow);
    position: relative;
}

.hamza-calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--hb-primary);
    color: #fff;
}

.hamza-calendar__prev,
.hamza-calendar__next {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background .2s;
    line-height: 1;
}

.hamza-calendar__prev:hover,
.hamza-calendar__next:hover {
    background: rgba(255,255,255,.15);
}

.hamza-calendar__month-title {
    font-weight: 700;
    font-size: 16px;
    text-transform: capitalize;
}

.hamza-calendar__header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid var(--hb-border);
}

.hamza-calendar__header-day {
    padding: 10px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--hb-text-light);
    text-transform: uppercase;
}

.hamza-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.hamza-calendar__day {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    cursor: default;
    transition: background .2s, color .2s;
    position: relative;
}

.hamza-calendar__day:nth-child(7n) {
    border-right: none;
}

.hamza-calendar__day--empty {
    background: transparent;
}

.hamza-calendar__day--unavailable {
    opacity: 0.35;
    cursor: default;
}

.hamza-calendar__day--available {
    cursor: pointer;
    color: var(--hb-primary);
    font-weight: 600;
}

.hamza-calendar__day--available:hover {
    background: var(--hb-primary-light);
}

.hamza-calendar__day--today::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--hb-primary);
    border-radius: 50%;
}

.hamza-calendar__day--selected {
    background: var(--hb-primary) !important;
    color: #fff !important;
    border-radius: 6px;
}

.hamza-calendar__day--selected::after {
    display: none;
}

.hamza-calendar__loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* ── Time Slots ─────────────────────────────────────────────────────── */

.hamza-slots__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 480px) {
    .hamza-slots__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.hamza-slot-btn {
    padding: 12px 8px;
    border: 2px solid var(--hb-border);
    background: var(--hb-bg);
    border-radius: var(--hb-radius);
    font-size: 15px;
    font-weight: 600;
    color: var(--hb-text);
    cursor: pointer;
    text-align: center;
    transition: border-color .2s, background .2s, color .2s;
}

.hamza-slot-btn:hover {
    border-color: var(--hb-primary);
    background: var(--hb-primary-light);
    color: var(--hb-primary);
}

.hamza-slot-btn--selected {
    border-color: var(--hb-primary) !important;
    background: var(--hb-primary) !important;
    color: #fff !important;
}

.hamza-slots__empty {
    text-align: center;
    color: var(--hb-text-light);
    padding: 30px 0;
}

.hamza-slots__loading {
    text-align: center;
    padding: 30px 0;
}

/* ── Form ───────────────────────────────────────────────────────────── */

.hamza-form__group {
    margin-bottom: 18px;
}

.hamza-form__group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--hb-text);
}

.hamza-form__group label .required {
    color: var(--hb-danger);
}

.hamza-form__group input[type="text"],
.hamza-form__group input[type="email"],
.hamza-form__group input[type="tel"],
.hamza-form__group input[type="number"],
.hamza-form__group select,
.hamza-form__group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--hb-border);
    border-radius: var(--hb-radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--hb-text);
    background: var(--hb-bg);
    transition: border-color .2s;
    box-sizing: border-box;
}

.hamza-form__group input:focus,
.hamza-form__group select:focus,
.hamza-form__group textarea:focus {
    outline: none;
    border-color: var(--hb-primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}

.hamza-form__group--phone .hamza-phone-wrap {
    display: flex;
    gap: 8px;
}

.hamza-form__group--phone select {
    width: auto;
    min-width: 120px;
    flex-shrink: 0;
}

.hamza-form__group--phone input[type="tel"] {
    flex: 1;
}

.hamza-form__group--checkbox label {
    font-weight: 400;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.hamza-form__group--checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.hamza-form__error {
    display: none;
    font-size: 13px;
    color: var(--hb-danger);
    margin-top: 4px;
}

.hamza-form__group--invalid input,
.hamza-form__group--invalid select,
.hamza-form__group--invalid textarea {
    border-color: var(--hb-danger);
}

.hamza-form__group--invalid .hamza-form__error {
    display: block;
}

/* ── Summary ────────────────────────────────────────────────────────── */

.hamza-summary {
    background: #f8f9fa;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: 20px;
    margin-bottom: 8px;
}

.hamza-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--hb-border);
}

.hamza-summary__row:last-child {
    border-bottom: none;
}

.hamza-summary__label {
    font-weight: 600;
    color: var(--hb-text-light);
}

.hamza-summary__value {
    font-weight: 600;
    color: var(--hb-text);
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.hamza-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: 2px solid transparent;
    border-radius: var(--hb-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, opacity .2s;
    text-decoration: none;
    line-height: 1.4;
}

.hamza-btn--primary {
    background: var(--hb-primary);
    color: #fff;
    border-color: var(--hb-primary);
}

.hamza-btn--primary:hover {
    background: var(--hb-primary-hover);
    border-color: var(--hb-primary-hover);
}

.hamza-btn--outline {
    background: transparent;
    color: var(--hb-primary);
    border-color: var(--hb-border);
}

.hamza-btn--outline:hover {
    border-color: var(--hb-primary);
    background: var(--hb-primary-light);
}

.hamza-btn--small {
    padding: 6px 16px;
    font-size: 13px;
}

.hamza-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Spinner ────────────────────────────────────────────────────────── */

.hamza-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid var(--hb-border);
    border-top-color: var(--hb-primary);
    border-radius: 50%;
    animation: hamzaSpin .7s linear infinite;
}

@keyframes hamzaSpin {
    to { transform: rotate(360deg); }
}

/* ── Success ────────────────────────────────────────────────────────── */

.hamza-success {
    text-align: center;
    padding: 30px 0;
}

.hamza-success__icon {
    margin-bottom: 20px;
}

.hamza-checkmark {
    width: 72px;
    height: 72px;
}

.hamza-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--hb-accent);
    fill: none;
    animation: hamzaStroke .6s cubic-bezier(.65,0,.45,1) forwards;
}

.hamza-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: var(--hb-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: hamzaStroke .4s cubic-bezier(.65,0,.45,1) .4s forwards;
}

@keyframes hamzaStroke {
    to { stroke-dashoffset: 0; }
}

.hamza-success__title {
    font-size: 24px;
    color: var(--hb-accent);
    margin-bottom: 16px;
}

.hamza-success__details {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 24px;
    background: #f8f9fa;
    border-radius: var(--hb-radius);
    padding: 16px 20px;
}

.hamza-success__detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.hamza-success__actions {
    margin-bottom: 16px;
}

.hamza-success__login-hint {
    font-size: 13px;
    color: var(--hb-text-light);
}

/* ── Error Message ──────────────────────────────────────────────────── */

.hamza-error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--hb-radius);
    padding: 14px 18px;
    color: var(--hb-danger);
    font-size: 14px;
    margin-top: 16px;
}

/* ── Badges ─────────────────────────────────────────────────────────── */

.hamza-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.hamza-badge--green {
    background: #d4edda;
    color: #155724;
}

.hamza-badge--yellow {
    background: #fff3cd;
    color: #856404;
}

.hamza-badge--red {
    background: #f8d7da;
    color: #721c24;
}

/* ── My Appointments ────────────────────────────────────────────────── */

.hamza-my-appointments {
    max-width: 640px;
    margin: 0 auto;
}

.hamza-my-appointments h3 {
    font-size: 18px;
    margin: 28px 0 14px;
    color: var(--hb-primary);
}

.hamza-lookup__form {
    max-width: 400px;
}

.hamza-appt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hamza-appt-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--hb-bg);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: 16px;
    box-shadow: var(--hb-shadow);
    transition: box-shadow .2s;
}

.hamza-appt-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.hamza-appt-card--past {
    opacity: 0.65;
}

.hamza-appt-card__date {
    flex-shrink: 0;
    width: 52px;
    text-align: center;
    background: var(--hb-primary-light);
    border-radius: var(--hb-radius);
    padding: 8px 4px;
}

.hamza-appt-card__day {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--hb-primary);
    line-height: 1.1;
}

.hamza-appt-card__month {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--hb-primary);
}

.hamza-appt-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 14px;
}

.hamza-appt-card__info strong {
    font-size: 15px;
}

.hamza-appt-card__actions {
    flex-shrink: 0;
}

.hamza-no-results {
    text-align: center;
    color: var(--hb-text-light);
    padding: 40px 0;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .hamza-progress__label {
        display: none;
    }

    .hamza-progress__dot {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .hamza-calendar__day {
        min-height: 40px;
        font-size: 13px;
    }

    .hamza-step__title {
        font-size: 18px;
    }

    .hamza-summary__row {
        flex-direction: column;
        gap: 2px;
    }

    .hamza-appt-card {
        flex-wrap: wrap;
    }
}
