/* GiftaBook — custom styles (Tailwind CSS loaded via CDN in base.html) */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Reduced motion: native fragment jumps (e.g. the FAQ's plain href="#top" Back to top, #487) must not animate. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Typography — apply Inter globally */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Serif headings utility — used with font-serif Tailwind class (Lora) */
.font-serif {
  font-family: 'Lora', Georgia, serif;
}

/* Better focus rings — override Tailwind default */
*:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
  border-radius: 4px;
}

/* The setup bar sits under the open mobile menu: hide it while the menu is open. */
html.nav-open [data-onboarding-fixed] {
  display: none;
}

/* Smooth hover transitions on interactive elements */
a, button {
  transition: color 150ms ease, background-color 150ms ease,
              border-color 150ms ease, box-shadow 150ms ease,
              transform 150ms ease, opacity 150ms ease;
}

/* Auth form inputs — allauth renders plain <input> elements without CSS classes */
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #111827;
  background-color: #ffffff;
  box-sizing: border-box;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="text"]:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.auth-form input.is-invalid {
  border-color: #f87171;
}

/* Password show/hide eye (#592): the button is added by app.js, so no-JS pages show a plain field. */
.password-field { position: relative; }
.auth-form .password-field input[type="password"],
.auth-form .password-field input[type="text"] { padding-right: 2.75rem; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.75rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: 0 0.75rem 0.75rem 0;
  cursor: pointer;
}
.password-toggle:hover { color: #111827; }
.password-toggle:focus-visible {
  outline: none;
  color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
}
/* Edge draws its own reveal control; hide it so there is only one eye. */
.password-field input::-ms-reveal,
.password-field input::-ms-clear { display: none; }

/* HTMX loading indicator — hidden by default, shown during in-flight requests */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* Inline remove confirmation — toggled via .confirming class on [data-remove] */
[data-remove] .remove-init   { display: flex; align-items: center; }
[data-remove] .remove-confirm { display: none; }
[data-remove].confirming .remove-init { display: none; }
[data-remove].confirming .remove-confirm { display: inline-flex; align-items: center; }
/* Keep the control visible while awaiting confirmation (even if row is un-hovered) */
[data-remove].confirming { opacity: 1 !important; }

/* On phones the confirm takes its own line under the title, so "Remove? Yes · No" never squeezes it */
@media (max-width: 639px) {
  [data-remove].confirming { flex-basis: 100%; }
  [data-remove].confirming .remove-confirm { width: 100%; justify-content: flex-end; }
}

/* A confirm that carries a warning (#260): take the whole row under the title so the text wraps */
[data-remove].remove-has-warning.confirming { flex-basis: 100%; }
[data-remove].remove-has-warning.confirming .remove-confirm { width: 100%; }

/* Reader band on phones: while a section editor is open it takes the band's full width and the avatar steps aside. */
@media (max-width: 639px) {
  [data-reader-band]:has([data-owner-band] form) [data-reader-avatar] { display: none; }
  [data-reader-band]:has([data-owner-band] form) [data-owner-band] { width: 100%; flex: 1 1 100%; }
}
