/*
 * ReserveYourSlot — app identity design system.
 *
 * Governs the app's own chrome only (marketing pages, dashboard, forms,
 * auth screens): light/creamy palette, one restrained accent color used
 * sparingly, a small type scale, and a spacing scale. See docs/style-note.md
 * for the rationale.
 *
 * This file must NEVER be used on the public event page — that surface is
 * themed per-event by the organizer via event-theme.css instead.
 */

:root {
  /* Palette: warm off-whites/neutrals as the base, one accent used sparingly. */
  --ry-cream-50: #fbf8f2;
  --ry-cream-100: #f5efe4;
  --ry-cream-200: #ece2d0;
  --ry-border: #e4d9c6;
  --ry-ink-900: #2b2620;
  --ry-ink-600: #6b6255;
  --ry-ink-400: #9a917f;
  --ry-accent-500: #c9682b;
  --ry-accent-600: #a8551f;
  --ry-accent-100: #f5e1d0;
  --ry-danger: #b3413a;
  --ry-success: #4f7a52;

  /* Type scale (system fonts only — no webfont download, keeps pages fast). */
  --ry-font-display: -apple-system, "Segoe UI", system-ui, sans-serif;
  --ry-font-body: -apple-system, "Segoe UI", system-ui, sans-serif;

  /* Spacing scale, rem-based. */
  --ry-space-1: 0.25rem;
  --ry-space-2: 0.5rem;
  --ry-space-3: 0.75rem;
  --ry-space-4: 1rem;
  --ry-space-5: 1.5rem;
  --ry-space-6: 2rem;
  --ry-space-7: 3rem;
  --ry-space-8: 4rem;

  --ry-radius: 0.75rem;
  --ry-radius-sm: 0.5rem;
}

body {
  background-color: var(--ry-cream-50);
  color: var(--ry-ink-900);
  font-family: var(--ry-font-body);
  letter-spacing: -0.01em;
}

.ry-display {
  font-family: var(--ry-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Navbar ---------------------------------------------------------- */

.ry-navbar {
  background-color: var(--ry-cream-50);
  border-bottom: 1px solid var(--ry-border);
}

.ry-navbar .navbar-brand {
  font-family: var(--ry-font-display);
  font-weight: 700;
  color: var(--ry-ink-900);
  display: flex;
  align-items: center;
  gap: var(--ry-space-2);
}

.ry-navbar .navbar-brand svg {
  height: 1.75rem;
  width: 1.75rem;
}

/* --- Buttons ----------------------------------------------------------- */

.btn-ry-accent {
  background-color: var(--ry-accent-500);
  border-color: var(--ry-accent-500);
  color: #fff;
}

.btn-ry-accent:hover,
.btn-ry-accent:focus {
  background-color: var(--ry-accent-600);
  border-color: var(--ry-accent-600);
  color: #fff;
}

.btn-ry-outline {
  background-color: transparent;
  border-color: var(--ry-border);
  color: var(--ry-ink-900);
}

.btn-ry-outline:hover {
  border-color: var(--ry-accent-500);
  color: var(--ry-accent-600);
}

/* Lift every solid/outline button off the page with a soft warm shadow,
   deepening slightly on hover. Link- and close-style buttons stay flat, and
   we don't touch :focus so the keyboard focus ring shows through. */
.btn-ry-accent,
.btn-ry-outline,
.btn-outline-danger,
.btn-light {
  box-shadow: 0 1px 2px rgba(43, 38, 32, 0.08);
}

.btn-ry-accent:hover,
.btn-ry-outline:hover,
.btn-outline-danger:hover,
.btn-light:hover {
  box-shadow: 0 2px 5px rgba(43, 38, 32, 0.12);
}

/* --- Dashboard: per-event action links -----------------------------------
   A <form>-wrapped button (Duplicate, Publish/Unpublish) must look and lay
   out exactly like the plain <a> links next to it, so the form itself is
   taken out of layout via display:contents and its button becomes a direct
   flex item alongside the links. */

.ry-inline-actions form {
  display: contents;
}

/* These action buttons sit on the cream page background (not a white card),
   so give them a white fill; the shadow comes from the shared button rule. */
.ry-inline-actions .btn-ry-outline {
  background-color: #fff;
}

.ry-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ry-ink-600);
  text-decoration: none;
}

.ry-action-link:hover,
.ry-action-link:focus {
  color: var(--ry-accent-600);
  text-decoration: underline;
}

/* --- Share page: social network icon buttons ----------------------------- */

.ry-social-btn {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  transition: transform 0.15s ease;
}

.ry-social-btn:hover,
.ry-social-btn:focus {
  transform: translateY(-2px);
}

.ry-social-btn svg {
  width: 100%;
  height: 100%;
}

/* --- Cards / surfaces ---------------------------------------------------- */

.ry-card {
  background-color: #fff;
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius);
  padding: var(--ry-space-5);
}

/* A card's section title: a very subtle full-width tinted bar so the name
   stands out slightly against the white card. Flex so a trailing "?" help
   button (and any "— optional" note) sits vertically centered with the text. */
.ry-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--ry-cream-100);
  padding: 0.3rem 0.6rem;
  border-radius: 0.3rem;
}

/* Little "?" next to a section title that opens an explanatory modal. */
.ry-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: 1px solid var(--ry-border);
  border-radius: 50%;
  background: #fff;
  color: var(--ry-ink-600);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

.ry-help-btn:hover,
.ry-help-btn:focus {
  border-color: var(--ry-accent-500);
  color: var(--ry-accent-600);
}

/* Public-page theme presets: little swatches that fill in the color pickers. */
.ry-theme-preset {
  width: 3rem;
  height: 2.25rem;
  border: 1px solid var(--ry-border);
  border-radius: 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.ry-theme-preset:hover,
.ry-theme-preset:focus {
  border-color: var(--ry-accent-500);
}

/* Live preview of the public sign-up page's look. Themed via --event-* vars
   set by the color pickers, so every border tracks the chosen theme (using
   the same color-mix borders as the real page) instead of the app's own. */
.ry-theme-preview {
  background-color: var(--event-bg);
  color: var(--event-fg);
  border: 1px solid var(--event-border, color-mix(in srgb, var(--event-fg) 15%, transparent));
}

.ry-theme-preview-title {
  font-weight: 600;
  margin-bottom: 1rem;
}

.ry-theme-preview-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--event-border, color-mix(in srgb, var(--event-fg) 15%, transparent));
  border-radius: 0.75rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
}

.ry-theme-preview-btn {
  background-color: var(--event-accent, var(--event-fg));
  color: var(--event-bg);
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  white-space: nowrap;
}

.ry-event-row {
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ry-event-row:hover,
.ry-event-row:focus {
  border-color: var(--ry-accent-500);
  box-shadow: 0 0.25rem 0.75rem rgba(43, 38, 32, 0.08);
  color: inherit;
}

.ry-muted {
  color: var(--ry-ink-600);
}

.ry-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ry-space-1);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--ry-cream-200);
  color: var(--ry-ink-600);
}

.ry-badge-accent {
  background-color: var(--ry-accent-100);
  color: var(--ry-accent-600);
}

/* --- Forms ------------------------------------------------------------ */

.form-control,
.form-select {
  border-color: var(--ry-border);
  border-radius: var(--ry-radius-sm);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ry-accent-500);
  box-shadow: 0 0 0 0.2rem var(--ry-accent-100);
}

/* --- Hero / marketing ---------------------------------------------------- */

.ry-hero {
  padding: var(--ry-space-8) 0;
}

/* --- Mobile-first touch targets ------------------------------------------ */

.btn {
  min-height: 2.75rem;
}

@media (max-width: 575.98px) {
  .ry-hero {
    padding: var(--ry-space-6) 0;
  }
}

/* --- Auth pages (django-allauth) --------------------------------------- */
/* See templates/allauth/layouts/base.html for why <main> itself is styled
   as the card, rather than wrapping a block allauth's templates control. */

.ry-auth-page main {
  max-width: 32rem;
  margin: var(--ry-space-5) auto;
  padding: var(--ry-space-5);
  background: #fff;
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius);
  /* base.html gives <main> flex-grow-1 so short pages still push the footer
     down. Here <main> is the card itself, so growing stretches the white box
     to the full viewport height and leaves a large empty area under the form.
     Cancel the growth and let the footer absorb the leftover space instead
     (both need !important — they're overriding Bootstrap utility classes). */
  flex-grow: 0 !important;
}

.ry-auth-page footer {
  margin-top: auto !important;
}

@media (max-width: 575.98px) {
  .ry-auth-page main {
    /* Keep the 1rem side gutters; only the vertical space tightens. */
    margin: var(--ry-space-4);
    padding: var(--ry-space-5) var(--ry-space-4);
  }
}

/* allauth stacks every field in a .mb-3; 1rem between a label/input pair and
   the next label makes the card run tall for no gain in readability. */
.ry-auth-page main form .mb-3 {
  margin-bottom: var(--ry-space-3) !important;
}

/* Sign-in only (templates/account/login.html sets this class): it has just
   two fields, so the default card reads as a narrow column. Must stay after
   the .ry-auth-page rule above — same specificity, so source order wins. */
.ry-auth-login main {
  max-width: 40rem;
}

/* django-allauth's own widgets don't carry Bootstrap classes (see
   allauth/elements/fields.html) — style them by context instead. */
.ry-auth-page input[type="text"],
.ry-auth-page input[type="email"],
.ry-auth-page input[type="password"],
.ry-auth-page input[type="tel"] {
  display: block;
  width: 100%;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius-sm);
  font-size: 1rem;
}

.ry-auth-page input:focus {
  outline: none;
  border-color: var(--ry-accent-500);
  box-shadow: 0 0 0 0.2rem var(--ry-accent-100);
}

/* --- Signup captcha ------------------------------------------------------ */
/* Markup: accounts/templates/accounts/widgets/captcha.html. The picture is
   drawn server-side in these same cream/ink/accent colors (see the constants
   at the top of accounts/captcha.py), so it reads as part of the card rather
   than as a widget dropped into it — keep the two palettes in step. */
.ry-captcha {
  display: flex;
  align-items: center;
  gap: var(--ry-space-2);
  margin-bottom: var(--ry-space-2);
}

.ry-captcha-image {
  display: block;
  /* Drawn at 360x120 and shown at half size, so the glyphs stay sharp on
     high-density screens. */
  width: 11.25rem;
  height: 3.75rem;
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius-sm);
  -webkit-user-select: none;
  user-select: none;
}

.ry-captcha-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius-sm);
  background: #fff;
  color: var(--ry-ink-600);
  cursor: pointer;
}

.ry-captcha-refresh:hover {
  color: var(--ry-accent-600);
  border-color: var(--ry-accent-500);
}

.ry-captcha-refresh:focus-visible {
  outline: none;
  border-color: var(--ry-accent-500);
  box-shadow: 0 0 0 0.2rem var(--ry-accent-100);
}

.ry-captcha-refresh svg {
  width: 1rem;
  height: 1rem;
}

/* One turn per click, as feedback that a new picture is on its way. */
.ry-captcha-refresh.is-spinning svg {
  animation: ry-captcha-spin 0.6s ease-in-out;
}

@keyframes ry-captcha-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ry-captcha-refresh.is-spinning svg {
    animation: none;
  }
}

/* The answer is five characters; a full-width box would suggest otherwise.
   The uppercasing is cosmetic only — the comparison in
   accounts.forms.SignupForm.clean_captcha is what makes case not matter. */
.ry-auth-page input.ry-captcha-input {
  width: 9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* --- Share row ----------------------------------------------------------- */
/* The public event page is themed by the organizer and loads event-theme.css
   instead of this file, so the same row is styled twice — once there against
   the event's colors, once here against the app's. Changing one means
   changing the other. Without these rules the icons fall back to browser
   defaults: underlines under every link, button chrome around the copy and
   native-share buttons. */

.ry-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.ry-share-row .js-native-share {
  border: 1px solid var(--ry-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  color: var(--ry-ink-900);
  background: transparent;
  text-decoration: none;
}

.ry-share-icon {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  background: none;
  padding: 0;
  position: relative;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.ry-share-icon:hover,
.ry-share-icon:focus {
  transform: translateY(-2px);
}

.ry-share-icon svg {
  width: 100%;
  height: 100%;
}

.ry-share-icon::after {
  content: "Copied!";
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ry-ink-900);
  color: var(--ry-cream-50);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.ry-share-icon.ry-show-copied::after {
  opacity: 1;
}

/* --- Notifications (success/info toasts) -------------------------------- */

.ry-toast-container {
  position: fixed;
  top: var(--ry-space-4);
  right: var(--ry-space-4);
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: var(--ry-space-2);
  max-width: 22rem;
}

.ry-toast-container .ry-toast {
  background-color: #e5f2e6;
  border-color: #c3ddc5;
  color: var(--ry-success);
  box-shadow: 0 0.5rem 1.5rem rgba(43, 38, 32, 0.12);
}

@media (max-width: 575.98px) {
  .ry-toast-container {
    left: var(--ry-space-4);
    right: var(--ry-space-4);
    max-width: none;
  }
}

/* --- Event form: image/logo upload preview ------------------------------- */

.ry-image-upload-preview {
  display: flex;
  align-items: center;
  gap: var(--ry-space-2);
}

.ry-image-upload-preview img {
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius-sm);
  background-color: var(--ry-cream-100);
}

.ry-image-upload-preview-cover img {
  width: 12rem;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.ry-image-upload-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: var(--ry-radius-sm);
  background: none;
  color: var(--ry-ink-600);
}

.ry-image-upload-remove:hover,
.ry-image-upload-remove:focus {
  background-color: var(--ry-cream-200);
  color: var(--ry-danger);
}

/* --- Timezone picker ------------------------------------------------------ */

.ry-tz-group-label {
  margin-top: var(--ry-space-3);
  margin-bottom: var(--ry-space-1);
}

.ry-tz-group:first-child .ry-tz-group-label {
  margin-top: 0;
}

.ry-tz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: none;
  background: none;
  border-radius: var(--ry-radius-sm);
  font-size: 0.9rem;
  color: var(--ry-ink-900);
}

.ry-tz-option:hover,
.ry-tz-option:focus {
  background-color: var(--ry-cream-100);
}

/* --- Header account menu --------------------------------------------------- */

.ry-avatar-btn {
  padding: 0;
  border: none;
  background: none;
  line-height: 0;
}

.ry-avatar-btn::after {
  display: none;
}

.ry-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--ry-accent-500);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.dropdown-menu {
  border-color: var(--ry-border);
  border-radius: var(--ry-radius-sm);
  box-shadow: 0 0.5rem 1.5rem rgba(43, 38, 32, 0.12);
  padding: var(--ry-space-1);
}

.dropdown-item {
  border-radius: var(--ry-radius-sm);
  padding: 0.5rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--ry-cream-100);
}

/* --- PWA install prompt --------------------------------------------------- */

.ry-install-prompt {
  position: fixed;
  right: var(--ry-space-4);
  bottom: var(--ry-space-4);
  z-index: 1085;
  width: 23rem;
  max-width: calc(100vw - 2 * var(--ry-space-4));
  display: flex;
  align-items: flex-start;
  gap: var(--ry-space-3);
  padding: var(--ry-space-4);
  background-color: var(--ry-cream-50);
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius);
  box-shadow: 0 0.75rem 2rem rgba(43, 38, 32, 0.18);
  animation: ry-install-rise 0.25s ease-out;
}

@keyframes ry-install-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ry-install-prompt {
    animation: none;
  }
}

.ry-install-icon {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: var(--ry-radius-sm);
}

.ry-install-title {
  font-family: var(--ry-font-display);
  font-weight: 700;
  margin-bottom: var(--ry-space-1);
}

.ry-install-text {
  color: var(--ry-ink-600);
  font-size: 0.875rem;
  margin-bottom: var(--ry-space-3);
}

.ry-install-actions {
  display: flex;
  align-items: center;
  gap: var(--ry-space-3);
}

@media (max-width: 575.98px) {
  .ry-install-prompt {
    left: var(--ry-space-3);
    right: var(--ry-space-3);
    bottom: var(--ry-space-3);
    width: auto;
    max-width: none;
  }
}
