/* ========================================================
   BEAUTYLINK — GLOBAL MOBILE-FIRST COMPONENTS
   ========================================================
   Глобальні стилі компонентів: auth, форми, flash, button overrides.
   Завантажується на всіх сторінках через base.html.

   Правила:
   - тема і всі токени живуть тільки в css/tokens.css;
   - кольори, шрифти, радіуси, відступи, тіні та z-index брати через var(...);
   - кнопки тут лише доповнюють базову систему;
   - page-specific стилі тримати у файлах конкретних сторінок;
   - мобільний пріоритет: 44px+ touch targets, safe-area, без горизонтального скролу.
   ======================================================== */

html {
  min-height: 100%;
  background: var(--primary-soft);
  /* Native app: disable browser pull-to-refresh & elastic scroll on the root */
  overscroll-behavior: none;
}

body.site-body,
body.admin-page,
body.admin-login-page {
  min-width: 320px;
  background: var(--app-page-bg);
  color: var(--text);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

/* Faster tap response — eliminates 300ms tap delay on iOS/Android */
a, button, [role="button"], label,
input[type="submit"], input[type="button"], input[type="reset"] {
  touch-action: manipulation;
}

/* Momentum scrolling for any overflow-y scroll containers */
.tab-pane, .today-tl-list, .ph-body,
[data-scroll] {
  -webkit-overflow-scrolling: touch;
}

body.site-body::before,
body.admin-page::before,
body.admin-login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 0%, rgb(var(--white-rgb) / .48), transparent 26rem),
    radial-gradient(circle at 95% 8%, rgb(var(--primary-rgb) / .17), transparent 22rem),
    radial-gradient(circle at 10% 92%, rgb(var(--accent-rgb) / .12), transparent 19rem);
}

.site-body {
  min-height: 100dvh;
}

.site-main {
  padding: 0;
}

.container {
  width: min(100%, var(--container-width));
  padding-inline: var(--app-page-pad);
}

h1,
h2,
h3 {
  letter-spacing: .01em;
}

h1 {
  font-size: clamp(30px, 8vw, 52px);
  line-height: .98;
}

h2 {
  font-size: clamp(22px, 6vw, 36px);
}

p {
  margin-bottom: .8rem;
}

a,
button,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

.soft-card,
.success-card,
.trial-expired-card,
.ph-map-wrap,
.rs-current,
.rv-booking-info,
.rv-done {
  background: var(--app-surface);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ph-floating-book,
.rs-slot {
  min-height: var(--button-height-md);
  border-radius: var(--radius-md);
  letter-spacing: .08em;
  font-weight: 800;
  box-shadow: none;
}

.btn-primary,
.ph-floating-book {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 62%, var(--text) 100%);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 10px 24px rgb(var(--primary-rgb) / .24);
}


/* Normalize browser search inputs so native magnifier/clear icons never overlap placeholders */
input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.mb-input,
.rv-textarea,
.rs-cal-arrow,
.ob-time-inp {
  background: var(--surface-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 600;
  min-height: var(--input-height);
  padding: .82rem 1rem;
}

.mb-input:focus,
.rv-textarea:focus {
  border-color: var(--primary);
  background: var(--surface-input-focus);
  box-shadow: var(--focus-ring);
}

.mb-label,
.rv-label,
.rs-label,
.rs-section-title,
.ph-profession {
  color: var(--primary-dark);
  letter-spacing: .1em;
}

.flash-container {
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  right: auto;
  width: min(360px, calc(100vw - 2 * var(--app-page-pad)));
  max-width: calc(100vw - 2 * var(--app-page-pad));
  gap: 8px;
  transform: translateX(-50%);
}

.flash {
  min-height: 0;
  padding: 10px 12px;
  align-items: flex-start;
  border-radius: var(--radius-18);
  background: rgb(var(--bg-rgb) / .92);
  border: 1px solid var(--app-border-strong);
  border-left-width: 4px;
  font-size: 13px;
  line-height: 1.35;
}

.flash span {
  min-width: 0;
}

.flash-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

/* Base footer/header spacing */
.site-footer {
  margin-top: 0;
  padding: 24px 0;
}

.footer-content {
  gap: 12px;
}

@media (max-width: 768px) {
  .site-footer {
    display: none;
  }
  .site-main {
    padding: 0;
  }
  .container {
    padding-inline: 14px;
  }
}

/* Auth pages */
.login-page .site-main {
  display: flex;
  align-items: center;
  padding: 14px 0;
  min-height: 100dvh;
}

.login-page .container {
  width: 100%;
}

.auth-header {
  margin-bottom: 16px;
}

.auth-header h1 {
  font-size: clamp(27px, 7vw, 36px);
}

.auth-header p {
  font-size: 14px;
  line-height: 1.45;
}

.auth-form,
.auth-form .form-group,
.auth-divider,
.auth-footer {
  margin-bottom: 14px;
}

/* Trial and error pages */
.trial-expired-page .site-main,
.booking-success-page .site-main,
.my-booking-page .site-main {
  min-height: 100dvh;
}

.trial-expired-wrap {
  min-height: auto;
  padding: 14px 0;
}

.success-shell {
  min-height: calc(100dvh - 2rem);
  padding: 1.25rem 1rem 2rem;
}

.trial-expired-card,
.soft-card.success-card {
  max-width: var(--mobile-width);
  margin: 0 auto;
  padding: clamp(18px, 5vw, 30px);
}

.trial-expired-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

.trial-expired-benefits {
  background: rgb(var(--white-rgb) / .45);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-18);
  padding: 12px 14px;
  margin-bottom: 16px;
}

/* Booking success / manage booking app screens */
.booking-success-page .site-main,
.my-booking-page .site-main {
  display: flex;
  align-items: stretch;
}

.booking-success-page .site-footer,
.my-booking-page .site-footer {
  display: none;
}

/* Reschedule and review */
.my-booking-page .mb-wrap {
  max-width: var(--mobile-width-lg);
  margin: 0 auto;
  padding: 14px 0 26px;
}

.my-booking-page .mb-header {
  margin-bottom: 12px;
}

.my-booking-page .mb-header h1 {
  font-size: clamp(28px, 8vw, 40px);
  margin-bottom: 6px;
}

.my-booking-page .rs-section,
.my-booking-page .rv-section {
  margin-bottom: 14px;
}

.my-booking-page .rs-cal-grid {
  gap: 4px;
}

.my-booking-page .rs-day {
  border-radius: var(--radius-14);
  background: rgb(var(--white-rgb) / .36);
}

.my-booking-page .rs-slots {
  gap: 8px;
}

.my-booking-page .rs-slot {
  flex: 1 0 calc(25% - 8px);
  padding: .72rem .5rem;
  background: rgb(var(--white-rgb) / .58);
}

.my-booking-page .rs-slot.sel,
.my-booking-page .rs-day.sel {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
}

.my-booking-page .rs-actions {
  gap: 10px;
  margin-top: 12px;
}

.my-booking-page .rv-stars {
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius-18);
  background: rgb(var(--white-rgb) / .42);
  border: 1px solid var(--app-border);
}

.my-booking-page .rv-star {
  color: rgb(var(--text-rgb) / .18);
}

.my-booking-page .rv-star.active {
  color: var(--primary-dark);
}

@media (max-width: 380px) {
  h1 { font-size: 28px; }
}

/* =====================================================
   AUTH REDESIGN
   Rose / Coral / Sage palette aligned with new home page
   ===================================================== */

.auth-redesign-page .site-footer {
  display: none;
}

.auth-redesign-page .site-main,
.login-page.auth-redesign-page .site-main {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: clamp(14px, 3vw, 34px) 0;
  overflow: hidden;
}


.auth-redesign-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, var(--mobile-width));
  margin-inline: auto;
}

/* Single-column phone layout at all screen sizes — site is mobile-first */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
}

.auth-shell--login {
  max-width: var(--mobile-width);
  margin: 0 auto;
}

.auth-shell--compact {
  max-width: var(--mobile-width);
  margin: 0 auto;
}

.auth-back-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 38px;
  padding: 8px 14px;
  margin-bottom: clamp(14px, 3vw, 22px);
  border-radius: var(--radius-full);
  background: rgb(var(--white-rgb) / .62);
  border: 1px solid rgb(var(--primary-rgb) / .16);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: none;
  box-shadow: 0 8px 20px rgb(var(--text-rgb) / .06);
}

.auth-back-chip:hover {
  color: var(--text);
  transform: translateY(-1px);
  background: rgb(var(--white-rgb) / .9);
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  margin: 0 0 10px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  color: var(--primary-dark);
  background: rgb(var(--primary-rgb) / .08);
  border: 1px solid rgb(var(--primary-rgb) / .14);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.auth-kicker::before {
  content: "\2726";
  color: var(--coral);
  font-size: 11px;
}

.auth-header {
  margin-bottom: clamp(16px, 3vw, 24px);
}

.auth-header h1 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: clamp(34px, 7vw, 54px);
  line-height: .94;
  letter-spacing: -.02em;
}

.auth-header p,
.auth-story-text {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.auth-redesign-form {
  margin: 0;
}

.auth-redesign-form .form-group,
.auth-redesign-form .auth-field {
  margin-bottom: 22px;
}

.auth-redesign-form label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.auth-input-wrap {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 0 10px;
  background: transparent;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgb(var(--primary-rgb) / 0.22);
  box-shadow: none;
  transition: border-bottom-color .18s ease;
}

.auth-input-wrap:focus-within {
  border-bottom-color: rgb(var(--primary-rgb) / 0.22);
  background: transparent;
  box-shadow: none;
}

.auth-input-wrap.is-autofilled,
.auth-input-wrap:has(input:-webkit-autofill),
.auth-input-wrap:has(input:autofill) {
  border-bottom-color: rgb(var(--primary-rgb) / 0.22) !important;
  transition: none !important;
}

.auth-input-icon {
  width: 22px;
  height: 22px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-input-wrap input,
.auth-input-wrap textarea,
.auth-input-wrap select {
  min-height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.auth-input-wrap.pw-wrap input {
  padding-right: 0;
}

/* визначаємо autofill через animation (JS слухає animationstart) */
@keyframes auth-autofill-on  { from {} to {} }
@keyframes auth-autofill-off { from {} to {} }

/* auth fields: hide Google/Chrome Autofill paint inside underline inputs */
.auth-input-wrap input:-webkit-autofill,
.auth-input-wrap input:-webkit-autofill:hover,
.auth-input-wrap input:-webkit-autofill:focus,
.auth-input-wrap textarea:-webkit-autofill,
.auth-input-wrap textarea:-webkit-autofill:hover,
.auth-input-wrap textarea:-webkit-autofill:focus,
.auth-input-wrap select:-webkit-autofill,
.auth-input-wrap select:-webkit-autofill:hover,
.auth-input-wrap select:-webkit-autofill:focus,
.auth-input-wrap input:autofill,
.auth-input-wrap textarea:autofill,
.auth-input-wrap select:autofill {
  outline: 0 !important;
  -webkit-text-fill-color: var(--ink) !important;
  color: var(--ink) !important;
  caret-color: var(--ink) !important;
  border: 0 !important;
  border-radius: 0 !important;
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
          box-shadow: 0 0 0 1000px transparent inset !important;
  background-color: transparent !important;
  background-image: linear-gradient(transparent, transparent) !important;
  -webkit-background-clip: text !important;
          background-clip: text !important;
  animation-name: auth-autofill-on !important;
  animation-duration: 1ms !important;
  animation-fill-mode: both !important;
  transition: background-color 999999s ease-out 0s,
              color 999999s ease-out 0s,
              -webkit-text-fill-color 999999s ease-out 0s !important;
}
.auth-input-wrap input:not(:-webkit-autofill) {
  animation-name: auth-autofill-off;
  animation-duration: 1ms;
}

/* клас додається через JS — прибирає зміну підкреслення при автозаповненні */
.auth-input-wrap.is-autofilled {
  border-bottom-color: rgb(var(--primary-rgb) / 0.22) !important;
  transition: none !important;
}

.auth-input-wrap .pw-eye {
    position: static;
    transform: none;
}

.auth-input-wrap .pw-eye:hover {
    color: var(--primary-dark);
    background: rgb(var(--primary-rgb) / 0.10);
}

.auth-row-links {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.help-link {
  color: var(--primary-dark);
  font-weight: 800;
}

.help-link:hover {
  color: var(--text);
}

.auth-submit-btn {
  min-height: var(--button-height-xl);
  border-radius: var(--radius-18);
  background: var(--btn-primary-bg);
  box-shadow: 0 14px 32px rgb(var(--primary-rgb) / .24);
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgb(var(--primary-rgb) / .32);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgb(var(--primary-rgb) / .24), transparent);
}

.auth-divider span {
  margin: 0;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: rgb(var(--white-rgb) / .48);
}

.auth-footer-panel {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-22);
  background: linear-gradient(135deg, rgb(var(--white-rgb) / .58), rgb(var(--primary-soft-rgb) / .5));
  border: 1px solid rgb(var(--primary-rgb) / .14);
  text-align: center;
}

.auth-footer-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.auth-footer-panel--soft {
  margin-top: 18px;
}

/* Auth story card: always hidden — mobile-first design, no desktop aside */
.auth-story-card {
  display: none;
}

@media (max-width: 980px) {
  .auth-shell--login,
.auth-shell--compact {
    grid-template-columns: 1fr;
    max-width: var(--mobile-width);
  }

}

@media (max-width: 680px) {
  .auth-redesign-page .site-main,
.login-page.auth-redesign-page .site-main {
    align-items: flex-start;
    padding-top: 10px;
  }

  .auth-header h1 {
    font-size: clamp(31px, 10vw, 40px);
  }

  .auth-benefit-grid {
    grid-template-columns: 1fr;
  }

  .auth-back-chip {
    min-height: 34px;
    margin-bottom: 12px;
  }
}


/* Login page: show phone/password form directly on the page,
without the main card shell */
.login-page .auth-login-panel {
  position: relative;
  isolation: isolate;
  overflow: visible;
  padding: clamp(8px, 2.2vw, 18px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.login-page .auth-login-panel .auth-footer-panel {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

.login-page .auth-login-panel .auth-footer-panel p {
  color: var(--text-secondary);
}

.login-page .auth-login-panel .auth-divider span {
  background: rgb(var(--bg-rgb) / .72);
}

.login-page .auth-login-panel {
  width: 100%;
  margin: 0 auto;
}

.login-page .auth-login-panel .auth-header,
.login-page .auth-login-panel .auth-form,
.login-page .auth-login-panel .auth-divider,
.login-page .auth-login-panel .auth-footer {
  max-width: none;
}

@media (max-width: 680px) {
  .login-page .auth-login-panel {
    padding: 10px 4px 18px;
  }
}

/* PWA install toast */
.app-install-toast {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
    z-index: 3000;
    max-width: 460px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 1px solid rgb(var(--primary-rgb) / .24);
    border-radius: var(--radius-18);
    background: rgb(var(--white-rgb) / .94);
    color: var(--text);
    box-shadow: 0 10px 34px rgb(var(--shadow-rgb) / .16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: appInstallToastIn .22s ease both;
}
.app-install-toast[hidden], .pwa-installed .app-install-toast { display: none !important; }
.app-install-icon {
    width: 32px; height: 32px; border-radius: var(--radius-12);
    display: flex; align-items: center; justify-content: center;
    background: rgb(var(--primary-rgb) / .13);
    color: var(--primary);
    flex-shrink: 0;
}
.app-install-copy { min-width: 0; line-height: 1.15; }
.app-install-copy strong {
    display: block; font-size: 13px; font-weight: 850;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-install-copy span {
    display: block; margin-top: 1px; font-size: 11px; font-weight: 650;
    color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-install-action { border-radius: var(--radius-full); padding: 7px 10px; font-size: 12px; line-height: 1; white-space: nowrap; box-shadow: 0 5px 16px rgb(var(--primary-rgb) / .28); }
.app-install-action:active { transform: scale(.96); }
.app-install-action:hover { opacity: .92; }
.app-install-close { border-radius: var(--radius-full); }
@keyframes appInstallToastIn {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Push offer after PWA install */
.push-install-offer {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 72px);
    z-index: 2900;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    border-radius: var(--radius-20);
    border: 1px solid var(--app-border);
    background: rgb(var(--bg-rgb) / .96);
    box-shadow: 0 8px 28px rgb(var(--shadow-rgb) / .18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: pushOfferIn .22s ease both;
}
.push-install-offer__icon { font-size: 18px; line-height: 1; text-align: center; }
.push-install-offer__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.push-install-offer__text strong { font-size: 13px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.push-install-offer__text span { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.push-install-offer__btn { padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.push-install-offer__close { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: none; background: none; color: var(--text-secondary); font-size: 14px; cursor: pointer; flex-shrink: 0; border-radius: var(--radius-6); }
.push-install-offer__close:active { background: rgb(var(--text-rgb) / .08); }
@keyframes pushOfferIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 430px) {
    .app-install-toast { grid-template-columns: 28px minmax(0, 1fr) auto 22px; gap: 6px; padding: 7px; border-radius: var(--radius-16); }
    .app-install-icon { width: 28px; height: 28px; border-radius: var(--radius-10); }
    .app-install-copy strong { font-size: 12.5px; }
    .app-install-copy span { font-size: 10.5px; max-width: 42vw; }
    .app-install-action { padding: 7px 9px; font-size: 11.5px; }
    .app-install-close { width: 22px; height: 22px; font-size: 15px; }
}

