@font-face {
  font-family: 'Sora';
  src: url('@/assets/fonts/Sora-Variable.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  font-style: normal;
}

:root {
  /* Colors: Electric Dusk */
  --color-gradient-start: #f06292;
  --color-gradient-mid: #ab47bc;
  --color-gradient-end: #5c6bc0;
  --color-accent: #ff7043;
  --color-text: #1c1c1e;
  --color-text-on-gradient: #ffffff;
  --color-surface: #fff5f8;
  --color-card: #ffffff;
  --color-dark-base: #1B1730;

  /* Danger / destructive actions */
  --color-danger: #fca5a5;
  --color-danger-bg: rgba(220, 38, 38, 0.15);
  --color-danger-bg-hover: rgba(220, 38, 38, 0.25);
  --color-danger-bg-strong: rgba(220, 38, 38, 0.2);
  --color-danger-border: rgba(220, 38, 38, 0.3);
  --color-danger-border-strong: rgba(220, 38, 38, 0.4);
  --color-danger-solid: #d32f2f;
  --color-danger-solid-hover: #b71c1c;
  --color-danger-solid-text: #fff;

  /* Glass system */
  --color-glass: rgba(255, 255, 255, 0.1);
  --color-glass-strong: rgba(255, 255, 255, 0.15);
  --color-glass-subtle: rgba(255, 255, 255, 0.05);
  --color-glass-border: rgba(255, 255, 255, 0.18);
  --color-glass-border-hover: rgba(255, 255, 255, 0.3);
  --color-glass-hover: rgba(255, 255, 255, 0.18);
  --color-glass-inner: rgba(27, 23, 48, 0.55);
  --color-glass-overlay: rgba(27, 23, 48, 0.4);

  /* Text on gradient (opacity variants) */
  --color-text-muted: rgba(255, 255, 255, 0.5);
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-soft: rgba(255, 255, 255, 0.85);
  --color-text-bright: rgba(255, 255, 255, 0.9);

  /* Glow border */
  --gradient-glow: conic-gradient(from 135deg, var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end), var(--color-gradient-start));

  /* Gradient */
  --gradient-primary: linear-gradient(135deg, #f06292 0%, #ab47bc 50%, #5c6bc0 100%);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.2rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;

  /* Borders */
  --radius-card: 14px;
  --radius-button: 14px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-button: 0 2px 8px rgba(0, 0, 0, 0.15);

  /* Layout */
  --content-max-width: 480px;
  --content-padding: 1.2rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--color-dark-base);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-color: var(--color-dark-base);
  background-image:
    radial-gradient(at 70% 20%, rgba(240, 98, 146, 0.55) 0px, transparent 50%),
    radial-gradient(at 25% 50%, rgba(171, 71, 188, 0.5) 0px, transparent 55%),
    radial-gradient(at 80% 70%, rgba(92, 107, 192, 0.55) 0px, transparent 50%),
    radial-gradient(at 35% 85%, rgba(255, 112, 67, 0.3) 0px, transparent 40%);
  filter: blur(80px);
  z-index: -1;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-container {
  width: 100%;
  max-width: var(--content-max-width);
  min-height: 100vh;
  padding: var(--content-padding);
  display: flex;
  flex-direction: column;
}

/* Card-style form fields */
.form-field {
  background: var(--color-card);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-card);
  padding: var(--spacing-md) var(--spacing-md);
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-field.glass {
  color: var(--color-text-on-gradient);
}

.form-field:focus {
  border-color: var(--color-glass-border-hover);
}

.form-field::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

.form-field.glass::placeholder {
  color: var(--color-text-muted);
}

textarea.form-field {
  resize: vertical;
  min-height: 5rem;
}

/* iOS Safari: datetime-local overflows container and shows empty when no value */
input[type="datetime-local"].form-field {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

input[type="datetime-local"].form-field.glass::-webkit-date-and-time-value {
  color: var(--color-text-on-gradient);
  text-align: left;
}

input[type="datetime-local"].form-field.glass::-webkit-datetime-edit {
  color: var(--color-text-on-gradient);
}

input[type="datetime-local"].form-field.glass::-webkit-datetime-edit-fields-wrapper {
  color: var(--color-text-on-gradient);
}

/* Form group (label + input) */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-on-gradient);
  padding-left: 0.25rem;
}

/* Primary action button */
.btn-primary {
  display: block;
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-card);
  color: var(--color-text);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-button);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease;
  text-align: center;
  text-decoration: none;
}

.btn-primary.glass {
  color: var(--color-text-on-gradient);
  border: 2px solid transparent;
  background:
    linear-gradient(var(--color-glass-inner), var(--color-glass-inner)) padding-box,
    var(--gradient-glow) border-box;
}

.btn-primary:hover {
  border-color: var(--color-glass-border-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error message */
.field-error {
  color: var(--color-danger-solid);
  font-size: 0.875rem;
  font-weight: 600;
  padding-left: 0.25rem;
}

/* Skeleton shimmer loading state */
.skeleton {
  background: linear-gradient(90deg, var(--color-card) 25%, #e0e0e0 50%, var(--color-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-card);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Glass System ── */

/* Glass surface: passive containers on gradient (cards, icon boxes) */
.glass {
  background: linear-gradient(135deg, var(--color-glass-strong) 0%, var(--color-glass-subtle) 100%);
  border: 1px solid var(--color-glass-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
}

.glass:hover:not(input):not(textarea):not(.btn-primary) {
  background: var(--color-glass-hover);
  border-color: var(--color-glass-border-hover);
}

/* Glass interactive inner: dark translucent fill for interactive elements (FAB, CTA) */
.glass-inner {
  background: var(--color-glass-inner);
  backdrop-filter: blur(16px);
}

/* Glow border: conic gradient wrapper with halo (static) */
.glow-border {
  background: var(--gradient-glow);
  padding: 2px;
  position: relative;
}

.glow-border::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: var(--gradient-glow);
  filter: blur(8px);
  opacity: 0.3;
  z-index: -1;
}

/* Glow border animated variant */
@property --glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.glow-border--animated {
  background: conic-gradient(from var(--glow-angle), var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end), var(--color-gradient-start));
  animation: glow-rotate 4s linear infinite;
}

.glow-border--animated::before {
  background: conic-gradient(from var(--glow-angle), var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end), var(--color-gradient-start));
  animation: glow-rotate 4s linear infinite;
}

@keyframes glow-rotate {
  to { --glow-angle: 360deg; }
}

/* ── Fixed Bottom Bar Components ── */

/* CTA wrapper (text button, e.g. "I'm attending!", "Post an update") */
.bar-cta {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-button);
  transition: transform 0.1s ease;
}

.bar-cta:hover {
  transform: scale(1.02);
}

.bar-cta:active {
  transform: scale(0.98);
}

.bar-cta-btn {
  display: block;
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: calc(var(--radius-button) - 2px);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-on-gradient);
  text-align: center;
  border: none;
  cursor: pointer;
}


/* Icon wrapper (e.g. calendar, bookmark buttons) */
.bar-icon {
  flex-shrink: 0;
  border-radius: var(--radius-button);
  transition: transform 0.1s ease;
}

.bar-icon:hover {
  transform: scale(1.02);
}

.bar-icon:active {
  transform: scale(0.98);
}

.bar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: var(--spacing-md);
  border-radius: calc(var(--radius-button) - 2px);
  border: none;
  cursor: pointer;
  color: var(--color-text-on-gradient);
  line-height: 0;
}

.bar-icon-btn svg {
  display: block;
}

/* Utility */
.text-center {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bottom sheet form */
.sheet-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-on-gradient);
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.rsvp-form__label,
.cancel-form__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-on-gradient);
  padding-left: 0.25rem;
}

.rsvp-form__field-error {
  color: var(--color-danger-solid);
  font-size: 0.875rem;
  font-weight: 600;
  padding-left: 0.25rem;
}

.rsvp-form__error {
  text-align: center;
}
