/* =====================================================
   TidyPaw Booking — Front-End Styles
   Brand color: #59BDBF
   ===================================================== */
:root {
    --tpb-primary:    #59BDBF;
    --tpb-primary-dk: #3fa5a7;
    --tpb-primary-lt: #e0f7f7;
    --tpb-text:       #111827;
    --tpb-muted:      #6b7280;
    --tpb-border:     #e5e7eb;
    --tpb-r:          12px;
}

/* ---- Trigger Button ---- */
.tpb-trigger-btn {
    background: #e53e3e;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 13px 32px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 14px rgba(229,62,62,.35);
    touch-action: manipulation;   /* prevents 300ms tap delay on mobile */
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}
.tpb-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229,62,62,.45);
}

/* ---- Overlay ---- */
.tpb-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
    animation: tpbFade .2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@keyframes tpbFade { from{opacity:0} to{opacity:1} }

.tpb-box {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: tpbUp .25s ease;
    margin: auto;
}
@keyframes tpbUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

.tpb-x {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none;
    font-size: 1.6rem; cursor: pointer;
    color: rgba(255,255,255,.8); line-height: 1; z-index: 5;
}
.tpb-x:hover { color: #fff; }

/* ---- Header ---- */
.tpb-header {
    background: var(--tpb-primary);
    padding: 28px 28px 22px;
    text-align: center; color: #fff;
    border-radius: 20px 20px 0 0;
}
.tpb-header__emoji { font-size: 2.4rem; margin-bottom: 8px; }
.tpb-header h2     { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; }
.tpb-header p      { opacity: .9; font-size: .875rem; margin: 0; }

/* ---- Steps ---- */
.tpb-steps {
    display: flex; align-items: center;
    padding: 18px 28px 0;
}
.tpb-step {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    opacity: .4; transition: opacity .2s;
    font-size: .7rem; font-weight: 600; color: var(--tpb-muted);
}
.tpb-step--active { opacity: 1; color: var(--tpb-primary); }
.tpb-step--done   { opacity: 1; }
.tpb-step__dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--tpb-border); color: var(--tpb-muted);
    font-weight: 700; font-size: .8rem;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.tpb-step--active .tpb-step__dot { background: var(--tpb-primary); color: #fff; }
.tpb-step--done   .tpb-step__dot { background: var(--tpb-primary-lt); color: var(--tpb-primary); }
.tpb-step__bar { flex: 1; height: 2px; background: var(--tpb-border); min-width: 16px; margin-bottom: 20px; }

/* ---- Pane / Fields ---- */
.tpb-pane { padding: 20px 28px 28px; }
.tpb-section-title { font-size: 1.2rem; font-weight: 800; margin: 0 0 16px; }
.tpb-field { margin-bottom: 14px; }
.tpb-field label {
    display: block; font-size: .85rem; font-weight: 600;
    color: var(--tpb-text); margin-bottom: 5px;
}
.tpb-req { color: #ef4444; }

.tpb-field input[type="text"],
.tpb-field input[type="email"],
.tpb-field input[type="tel"],
.tpb-field select,
.tpb-field textarea {
    width: 100%; padding: 11px 13px;
    border: 1.5px solid var(--tpb-border);
    border-radius: var(--tpb-r);
    font-size: .9rem; color: var(--tpb-text);
    font-family: inherit; background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.tpb-field input:focus,
.tpb-field select:focus,
.tpb-field textarea:focus {
    outline: none;
    border-color: var(--tpb-primary);
    box-shadow: 0 0 0 3px rgba(89,189,191,.15);
}
.tpb-field input.tpb-invalid,
.tpb-field select.tpb-invalid { border-color: #ef4444; }
.tpb-field textarea { resize: vertical; min-height: 80px; }

.tpb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpb-row--btns { margin-top: 20px; }
@media (max-width: 480px) { .tpb-row { grid-template-columns: 1fr; } }

/* ---- Frequency Cards ---- */
.tpb-freq-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 14px; /* space for the badge above first card */
}
@media (max-width: 480px) { .tpb-freq-grid { grid-template-columns: repeat(2,1fr); } }

.tpb-freq-card {
    position: relative;
    border: 2px solid var(--tpb-border);
    border-radius: var(--tpb-r);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tpb-freq-card input[type="radio"] { display: none; }
.tpb-freq-card:hover { border-color: var(--tpb-primary); background: var(--tpb-primary-lt); }
.tpb-freq-card--active {
    border-color: var(--tpb-primary);
    background: var(--tpb-primary-lt);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(89,189,191,.2);
}
.tpb-freq-card__title {
    font-size: .8rem; font-weight: 700; color: var(--tpb-text);
    line-height: 1.3;
}


/* ---- Dog slider ---- */
.tpb-slider-wrap { position: relative; padding-bottom: 34px; }
.tpb-slider-wrap input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; border-radius: 3px;
    background: var(--tpb-border); outline: none; cursor: pointer;
    border: none !important; padding: 0 !important; box-shadow: none !important;
}
.tpb-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--tpb-primary); border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    cursor: pointer; margin-top: -11px;
}
.tpb-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--tpb-primary); border: 3px solid #fff; cursor: pointer;
}
.tpb-ticks {
    display: flex; justify-content: space-between;
    position: absolute; bottom: 0; left: 0; right: 0;
    font-size: .72rem; color: var(--tpb-muted); text-align: center;
}
.tpb-ticks span { flex: 1; transition: color .15s, font-weight .15s; }
.tpb-ticks span.active { color: var(--tpb-text); font-weight: 700; }

/* ---- Price Box ---- */
.tpb-price-box {
    background: var(--tpb-primary-lt);
    border: 2px solid var(--tpb-primary);
    border-radius: var(--tpb-r);
    padding: 20px; text-align: center;
    margin: 24px 0 20px;
}
.tpb-price-box__label {
    font-size: .7rem; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: var(--tpb-muted); margin-bottom: 6px;
}
.tpb-price-box__amount { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
#tpb-price {
    font-size: 2.6rem; font-weight: 900; color: var(--tpb-primary);
    transition: transform .18s;
}
.tpb-price-box__unit { color: var(--tpb-muted); font-size: .9rem; }
.tpb-price-box__sub  { color: var(--tpb-primary); font-size: .8rem; margin: 6px 0 0; font-weight: 600; }

/* ---- Plan summary bar ---- */
.tpb-plan-summary {
    background: var(--tpb-primary-lt);
    border-radius: var(--tpb-r);
    padding: 10px 14px;
    font-size: .85rem;
    color: var(--tpb-text);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tpb-change-plan {
    margin-left: auto; background: none; border: 1px solid var(--tpb-primary);
    color: var(--tpb-primary); border-radius: 50px;
    padding: 3px 12px; font-size: .75rem; font-weight: 600; cursor: pointer;
}

/* ---- Buttons ---- */
.tpb-btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tpb-primary); color: #fff;
    border: none; border-radius: 50px;
    padding: 13px 28px; font-size: .9rem; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: transform .15s, box-shadow .15s;
}
.tpb-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(89,189,191,.35);
}
.tpb-btn-full { width: 100%; }
.tpb-btn-outline {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: var(--tpb-muted);
    border: 1.5px solid var(--tpb-border); border-radius: 50px;
    padding: 12px 22px; font-size: .875rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: border-color .15s, color .15s;
}
.tpb-btn-outline:hover { border-color: var(--tpb-primary); color: var(--tpb-primary); }

/* ---- Add-on box ---- */
.tpb-addon-box {
    border: 2px solid var(--tpb-border);
    border-radius: var(--tpb-r);
    padding: 16px; margin: 16px 0;
}
.tpb-addon-header { font-size: .9rem; font-weight: 800; margin-bottom: 12px; }
.tpb-addon-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--tpb-border); cursor: pointer;
}
.tpb-addon-item:last-child { border-bottom: none; padding-bottom: 0; }
.tpb-addon-item input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--tpb-primary);
    flex-shrink: 0; margin-top: 2px; cursor: pointer;
}
.tpb-addon-text { font-size: .875rem; }
.tpb-addon-text strong { display: block; font-weight: 700; margin-top: 2px; }

/* ---- Messages ---- */
.tpb-msg { margin-top: 10px; padding: 11px 14px; border-radius: 8px; font-size: .85rem; }
.tpb-msg--error   { background: #fee2e2; color: #991b1b; }
.tpb-msg--success { background: #d1fae5; color: #065f46; }

/* ---- Processing ---- */
.tpb-processing {
    padding: 40px; text-align: center; color: var(--tpb-muted);
}
.tpb-spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 4px solid var(--tpb-primary-lt);
    border-top-color: var(--tpb-primary);
    animation: tpbSpin .7s linear infinite;
    margin: 0 auto 16px;
}
@keyframes tpbSpin { to { transform: rotate(360deg); } }

/* ================================================================
   REFERRAL INVITE WIDGET
   ================================================================ */
.tpb-invite-widget {
    max-width: 540px;
    margin: 0 auto;
    font-family: inherit;
    background: #fff;
    border-radius: 18px;
    padding: 32px 28px 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

/* ---- Form wrap ---- */
.tpb-invite-form-wrap {
    display: flex;
    flex-direction: column;
}

/* ---- Individual field group (label + input) ---- */
.tpb-invite-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
    position: relative;
}

.tpb-invite-label {
    font-size: .9rem;
    font-weight: 600;
    color: #111827;
}

.tpb-req {
    color: #e11d48;
}

.tpb-invite-field {
    position: relative;
    width: 100%;
}

.tpb-invite-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: .95rem;
    color: #374151;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
}

.tpb-invite-field input:focus {
    border-color: #9ca3af;
}

.tpb-invite-field input[readonly],
.tpb-invite-field input[disabled],
.tpb-invite-locked .tpb-invite-field input {
    background: #f9fafb;
    color: #6b7280;
    cursor: default;
}

/* ---- Friend section heading ---- */
.tpb-invite-friend-label {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 6px 0 18px;
}

/* ---- Friend entries ---- */
.tpb-invite-friend-entry {
    border-top: 1px solid #f3f4f6;
    padding-top: 4px;
    margin-bottom: 4px;
    position: relative;
}

.tpb-invite-friend-entry:first-child {
    border-top: none;
    padding-top: 0;
}

/* Remove friend button */
.tpb-remove-friend {
    position: absolute;
    top: 8px;
    right: 0;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.tpb-remove-friend:hover {
    color: #e11d48;
}

/* ---- + Add Friend button ---- */
.tpb-invite-add-friend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 18px;
    background: #fff;
    color: #374151;
    border: 1.5px solid #d1d5db;
    border-radius: 50px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: border-color .2s, color .2s;
}
.tpb-invite-add-friend:hover {
    border-color: #6b7280;
    color: #111827;
}

/* ---- Submit button ---- */
.tpb-invite-send-btn {
    width: 100%;
    padding: 15px;
    background: #e11d48;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .01em;
    transition: background .2s, transform .1s;
    margin-top: 4px;
}
.tpb-invite-send-btn:hover {
    background: #be123c;
}
.tpb-invite-send-btn:active {
    transform: scale(.98);
}
.tpb-invite-send-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

/* ---- Success / error message ---- */
#tpb-invite-msg {
    margin-top: 16px;
    font-size: .875rem;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    line-height: 1.5;
}

/* ---- Privacy note ---- */
.tpb-invite-privacy {
    margin-top: 16px;
    font-size: .8rem;
    color: #6b7280;
    text-align: center;
}
.tpb-invite-privacy a {
    color: #e11d48;
    text-decoration: underline;
}

/* ---- Login notice ---- */
.tpb-invite-login-notice {
    margin-top: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    font-size: .875rem;
    color: #92400e;
    text-align: center;
}
.tpb-invite-login-notice a {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
}
