/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 */

:root {
  color-scheme: light;

  /* Neutrals */
  --bg: #f7f1e7;
  --surface: #efe4d6;
  --text: #2a2623;
  --muted: #6e655e;

  /* Accents */
  --primary: #c46b4e;
  --primary-2: #a14f3a;
  --sage: #7e8a63;
  --juniper: #3f5b4a;
  --sky: #7fa6b6;
  --night: #1f2a2e;
  --glow: #f2b394;

  /* UI tokens */
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 6px 14px rgba(31, 42, 46, 0.08);
  --shadow-md: 0 14px 34px rgba(31, 42, 46, 0.12);
  --border: rgba(42, 38, 35, 0.1);
  --border-strong: rgba(42, 38, 35, 0.16);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Legacy tokens */
  --ink: var(--text);
  --card: var(--surface);
  --accent: var(--primary);
  --accent-dark: var(--primary-2);
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  letter-spacing: -0.01em;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background:
    radial-gradient(circle at 10% 10%, rgba(196, 107, 78, 0.08), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(126, 138, 99, 0.06), transparent 45%),
    radial-gradient(circle at 30% 90%, rgba(127, 166, 182, 0.05), transparent 40%),
    repeating-linear-gradient(
      0deg,
      rgba(42, 38, 35, 0.015) 0px,
      rgba(42, 38, 35, 0.015) 1px,
      transparent 1px,
      transparent 5px
    );
  mix-blend-mode: multiply;
}

.page,
.nav,
.flash {
  position: relative;
  z-index: 1;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

h1,
h2,
h3 {
  font-family: "Fraunces", ui-serif, Georgia, serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
}

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
}

h3 {
  font-size: 1.25rem;
}

.card h1::after {
  content: "";
  display: block;
  height: 8px;
  width: 86px;
  border-radius: 999px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--primary), var(--sage), var(--sky));
  opacity: 0.9;
}

p {
  margin: 0 0 1rem;
  color: var(--text);
}

code,
pre,
.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.92em;
}

code {
  background: rgba(63, 91, 74, 0.12);
  border-radius: 6px;
  padding: 0 0.35em;
}

a {
  color: var(--juniper);
  text-decoration: none;
  background-image: linear-gradient(to right, rgba(196, 107, 78, 0.45), rgba(196, 107, 78, 0.45));
  background-position: 0 1.08em;
  background-repeat: no-repeat;
  background-size: 100% 2px;
  transition: color 160ms var(--ease), background-size 220ms var(--ease);
}

a:hover {
  color: var(--primary-2);
  background-size: 100% 5px;
}

.small,
small {
  color: var(--muted);
  font-size: 0.92rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: -40% -30% auto -30%;
  height: 80px;
  background: radial-gradient(circle at 50% 50%, rgba(242, 179, 148, 0.35), transparent 60%);
  transform: rotate(-6deg);
  pointer-events: none;
}

.meta {
  color: var(--muted);
}

.field {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input,
select,
textarea {
  background: rgba(247, 241, 231, 0.7);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(196, 107, 78, 0.55);
  box-shadow: 0 0 0 4px rgba(196, 107, 78, 0.18);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 42, 46, 0.1);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.button.primary {
  background: linear-gradient(180deg, rgba(196, 107, 78, 1), rgba(161, 79, 58, 1));
  color: var(--bg);
  box-shadow: 0 10px 22px rgba(161, 79, 58, 0.25);
  border-color: transparent;
}

.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(161, 79, 58, 0.3);
}

.button.primary:active {
  transform: translateY(1px) scale(0.99);
}

.button.secondary {
  background: rgba(247, 241, 231, 0.6);
  color: var(--juniper);
  border: 1px solid rgba(63, 91, 74, 0.25);
}

.button.secondary:hover {
  background: rgba(126, 138, 99, 0.14);
  border-color: rgba(126, 138, 99, 0.35);
}

.button[disabled],
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.form-errors {
  border: 1px solid rgba(176, 58, 46, 0.35);
  background: rgba(176, 58, 46, 0.08);
  color: #7a1f17;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 0 16px;
}

.form-errors ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.status {
  color: var(--muted);
}

.error {
  color: #b03a2e;
}

.flash {
  max-width: 860px;
  margin: 12px auto 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(242, 179, 148, 0.22);
  color: var(--night);
  border: 1px solid rgba(196, 107, 78, 0.35);
  box-shadow: var(--shadow-sm);
}

.flash.notice {
  background: rgba(127, 166, 182, 0.2);
  border-color: rgba(127, 166, 182, 0.35);
  color: var(--night);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(10px);
  background: rgba(247, 241, 231, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-title {
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--juniper);
  text-decoration: none;
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-user form {
  margin: 0;
  display: inline-flex;
}

.nav-email {
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-action {
  padding: 8px 12px;
  font-size: 0.95rem;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--juniper);
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  background-image: linear-gradient(to right, rgba(196, 107, 78, 0.45), rgba(196, 107, 78, 0.45));
  background-position: 0 1.08em;
  background-repeat: no-repeat;
  background-size: 100% 2px;
  transition: color 160ms var(--ease), background-size 220ms var(--ease);
}

.link-button:hover {
  color: var(--primary-2);
  background-size: 100% 5px;
}

.qr {
  display: inline-block;
  max-width: min(360px, 92vw);
  padding: 12px;
  background: rgba(247, 241, 231, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.qr svg {
  display: block;
  width: 100%;
  height: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.resource-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.resource-item {
  margin: 0;
}

.resource-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(247, 241, 231, 0.65);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
  color: inherit;
  background-image: none;
}

.resource-item-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(196, 107, 78, 0.3);
  background-image: none;
}

.resource-item-link .badge {
  flex-shrink: 0;
}

.resource-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resource-link {
  font-weight: 600;
  font-size: 1.05rem;
}

.resource-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.display-page .card {
  padding: 28px;
}

.display-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
}

.display-main .meta strong {
  color: var(--night);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.detail-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  font-size: 1rem;
  color: var(--text);
}

.detail-label {
  font-weight: 600;
  color: var(--muted);
}

.display-qr {
  text-align: center;
}

.qr-large {
  max-width: min(420px, 90vw);
}

@media (max-width: 820px) {
  .display-grid {
    grid-template-columns: 1fr;
  }

  .detail-item {
    grid-template-columns: 1fr;
  }
}

.auth-page {
  padding-top: 40px;
}

.auth-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
}

.auth-card {
  padding: 26px 24px;
}

.auth-form .field + .field {
  margin-top: 14px;
}

.auth-note {
  border: 1px dashed rgba(63, 91, 74, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(247, 241, 231, 0.6);
  margin: 14px 0;
}

@media (max-width: 760px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

.org-mark {
  text-align: center;
  margin-bottom: 16px;
}

.org-mark img {
  display: inline-block;
  max-width: 220px;
  height: auto;
}

.org-name {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
