/*
 * The club's windows (club-client.js): «who are you» and «invite friends», and the cart's order
 * window. Shared by the shop, the cart and the game page, in Yalda's design system (/ui/yalda.css first).
 * On a phone a window is a sheet rising from the bottom of the screen; from 576px up it opens in the middle.
 */
/* an element marked hidden stays hidden, whatever display its class gives it */
[hidden] {
  display: none !important;
}

.tfc-locked {
  overflow: hidden;
}

.tfc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgb(43 26 29 / 0);
  font-family: var(--font-sans);
  direction: rtl;
  transition:
    background-color 0.22s ease,
    backdrop-filter 0.22s ease;
}
.tfc-overlay.is-open {
  background: rgb(43 26 29 / 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.tfc-dialog {
  position: relative;
  display: grid;
  gap: 16px;
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 -10px 40px -10px rgb(43 26 29 / 0.35);
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tfc-overlay.is-open .tfc-dialog {
  transform: none;
}
@media (min-width: 576px) {
  .tfc-overlay {
    align-items: center;
    padding: 20px;
  }
  .tfc-dialog {
    max-width: 512px;
    padding-bottom: 20px;
    border-radius: var(--radius-2xl);
    box-shadow: 0 24px 60px -20px rgb(43 26 29 / 0.45);
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition:
      transform 0.22s ease,
      opacity 0.22s ease;
  }
  .tfc-overlay.is-open .tfc-dialog {
    opacity: 1;
  }
}

/* the close button sits in the start corner, the title beside it; a hairline under them, from
   one edge of the window to the other (as on Sabad), sets the title apart from what follows */
.tfc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline: -20px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--border);
}
.tfc-title {
  flex: 1;
  margin: 0;
  color: var(--foreground);
  font-size: 18px;
  font-weight: 700;
}
.tfc-close {
  order: -1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: none;
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.tfc-close:hover {
  background: var(--accent);
  color: var(--foreground);
}
.tfc-body {
  min-width: 0;
}

.tfc-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tfc-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* a required field: a red star after its label */
.tfc-req {
  margin-inline-start: 3px;
  color: var(--destructive);
}
.tfc-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
}
/* the label as wide as its words: a tap on the empty space beside it does not focus the field */
.tfc-label > label {
  align-self: flex-start;
  cursor: pointer;
}
.tfc-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 16px; /* 16px keeps iPhones from zooming into the field */
  font-weight: 500;
  box-shadow: 0 1px 2px rgb(43 26 29 / 0.04);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
/* the order window's address: a few lines */
.tfc-textarea {
  height: auto;
  min-height: 68px;
  padding: 10px 14px;
  line-height: 1.7;
  resize: vertical;
}
@media (min-width: 576px) {
  .tfc-input {
    font-size: 14px;
  }
}
.tfc-input::placeholder {
  color: rgb(107 90 92 / 0.7);
}
.tfc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(227 160 171 / 0.4);
}
.tfc-input[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px rgb(180 35 24 / 0.15);
}
.tfc-textarea {
  height: auto;
  min-height: 72px;
  padding-block: 10px;
  resize: vertical;
}
.tfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.tfc-btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 2px rgb(155 27 48 / 0.2);
}
.tfc-btn--primary:hover {
  background: var(--primary-hover);
  color: var(--primary-foreground);
}
.tfc-btn--ghost {
  border-color: var(--input);
  background: var(--card);
  color: var(--foreground);
}
.tfc-btn--ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}
.tfc-btn.is-busy,
.tfc-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}
.tfc-btn:focus-visible,
.tfc-close:focus-visible,
.tfc-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(227 160 171 / 0.6);
}
.tfc-link {
  padding: 4px 2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* an error: plain red text, right under its field */
.tfc-error {
  margin: 0;
  color: var(--destructive);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.7;
}
.tfc-fields > .tfc-error {
  margin-top: -8px;
}
.tfc-error:empty {
  display: none;
}

.tfc-contact {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
  text-align: center;
}
.tfc-contact a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  unicode-bidi: isolate;
}

.tfc-share {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .tfc-overlay,
  .tfc-dialog {
    transition: none;
  }
}

/* the close button's icon (Hugeicons cancel-01) */
.tfc-close svg {
  width: 20px;
  height: 20px;
}
