/* Buttons - Neo-Brutalism + Ethereal Glow */
.btn-primary {
  display: inline-block;
  background-color: var(--primary);
  color: var(--white);
  border: 2px solid var(--primary-dark);
  border-radius: var(--radius-pill);
  padding: 14px 32px;
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  box-shadow: 4px 4px 0px var(--accent);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
  z-index: -1;
}
.btn-primary:hover::before {
  left: 100%;
}
.btn-primary:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--accent), var(--shadow-glow);
  background-color: var(--primary-dark);
  color: var(--white);
}

.btn-secondary {
  display: inline-block;
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-card);
  padding: 12px 24px;
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}
.btn-secondary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: var(--primary-dark);
  border: 2px solid var(--primary);
  border-radius: var(--radius-pill);
  padding: 14px 32px;
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  box-shadow: 4px 4px 0px var(--ethereal-cyan);
}
.btn-outline:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--ethereal-cyan);
}

/* Forms */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-700);
  margin-bottom: 6px;
}
.input-field {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0 16px;
  font-family: var(--font-base);
  font-size: 16px;
  color: var(--neutral-900);
  transition: var(--transition-fast);
  background: var(--white);
}
.input-field:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-light);
}

textarea.input-field {
  height: auto;
  min-height: 100px;
  padding: 12px 16px;
  resize: vertical;
}

/* Cards - Glassmorphism & Neo-Brutalism Hybrid */
.card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  border: 2px solid var(--white);
  transition: var(--transition-slow);
  position: relative;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
  pointer-events: none;
}
.card:hover {
  box-shadow: var(--shadow-lg), 8px 8px 0px var(--accent-light);
  transform: translateY(-8px);
  border-color: var(--ethereal-cyan);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
}
.status-badge.draft {
  background-color: #F3F4F6;
  color: #6B7280;
}
.status-badge.submitted {
  background-color: #EFF6FF;
  color: #1D4ED8;
}
.status-badge.review {
  background-color: #FFFBEB;
  color: #D97706;
}
.status-badge.clarification {
  background-color: #FEF2F2;
  color: #DC2626;
}
.status-badge.final {
  background-color: #F0FDF4;
  color: #16A34A;
}

/* Typography Utilities */
.section-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: 8px;
}
.section-sub {
  font-size: 16px;
  color: var(--neutral-400);
  margin-bottom: 32px;
}
.caption {
  font-size: 12px;
  color: var(--neutral-400);
}

/* Basic SVG Placeholders */
.icon-placeholder {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  line-height: 32px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

/* Header & Navbar - Glassmorphism */
.header, .navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  transition: var(--transition-slow);
}
.header-container, .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  max-width: 1600px;
  width: 95%;
  margin: 0 auto;
}
.nav-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: none;
  letter-spacing: -1px;
}
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--neutral-700);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--ethereal-purple);
  transition: var(--transition-fast);
}
.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary-dark);
}
.nav-cta {
  padding: 8px 16px;
}
.nav-cta-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--white);
}

/* Footer */
.site-footer {
  background-color: var(--neutral-900);
  color: var(--white);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand h2 {
  color: var(--white);
  margin-bottom: 16px;
}
.footer-brand p {
  color: var(--neutral-400);
}
.footer-links h4 {
  color: var(--white);
  margin-bottom: 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-links ul {
  list-style: none;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--neutral-400);
}
.footer-links a:hover {
  color: var(--white);
}
.footer-bottom {
  background-color: #111112;
  padding: 24px 0;
  text-align: center;
  color: var(--neutral-400);
  font-size: 13px;
  border-top: 1px solid #333;
}
.footer-bottom-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom-links a {
  color: var(--neutral-400);
  margin-left: 16px;
}

/* Responsive Navbar */
@media (max-width: 1023px) {
  .header-container, .nav-container {
    position: relative;
    width: min(100% - 32px, 1500px);
    min-height: 76px;
    height: auto;
    padding-block: 8px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }
  .nav-links.active {
    display: flex;
  }
  .nav-links li {
    border-bottom: 1px solid var(--border);
  }
  .nav-links a {
    display: block;
    padding: 16px 24px;
  }
  .hamburger {
    display: block;
  }
  .nav-cta-wrapper {
    display: none;
  }
}
@media (max-width: 639px) {
  .header-container, .nav-container,
  .navbar .nav-container {
    width: calc(100% - 24px);
  }
  .brand-logo-wrapper { min-width: 0; gap: 8px; }
  .brand-logo-img { width: auto; max-width: 44px; height: 44px !important; object-fit: contain; }
  .brand-logo-text { font-size: 10px; line-height: 1.2; }
  .brand-logo-note { font-size: 8px; }
  .hamburger { flex: 0 0 auto; color: var(--primary-dark); }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom-flex {
    flex-direction: column;
    gap: 16px;
  }
  .footer-bottom-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
  .footer-bottom-links a { margin-left: 0; }
}

/* Brand Logo Component */
.brand-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 8px 0;
  text-decoration: none;
}
.brand-logo-img {
  height: 86px;
  max-height: 86px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-logo-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
  text-align: center;
}
.brand-logo-note {
  display: inline-block;
  width: 100%;
  margin-top: 3px;
  color: var(--neutral-700);
  font-size: 9px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  letter-spacing: .01em;
}

/* Default public shell — Sample 2 forest theme */
body {
  --s2-ink: #0b211a;
  --s2-forest: #064e3b;
  --s2-leaf: #10b981;
  --s2-lime: #d9f99d;
  --s2-sand: #f6f2e8;
  --s2-gold: #e5ad37;
}

.navbar {
  position: sticky;
  top: 0;
  border-bottom: 1px solid rgba(11, 33, 26, .1);
  background: rgba(246, 242, 232, .9);
  box-shadow: 0 10px 30px rgba(6, 78, 59, .08);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.navbar .nav-container { width: min(100% - 48px, 1500px); max-width: none; }
.navbar .nav-links { gap: 8px; }
.navbar .nav-links a { padding: 9px 13px; border-radius: 999px; color: var(--s2-ink); font-weight: 700; }
.navbar .nav-links a:hover { background: rgba(16, 185, 129, .12); color: var(--s2-forest); }
.navbar .brand-logo-text { color: var(--s2-forest); }

.navbar .nav-cta-wrapper :is(.btn-primary, .btn-outline) {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(6, 78, 59, .28);
  border-radius: 8px;
  color: var(--s2-forest);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  box-shadow: none;
}
.navbar .nav-cta-wrapper .btn-primary { background: var(--s2-forest); color: #fff; }
.navbar .nav-cta-wrapper :is(.btn-primary, .btn-outline):hover { transform: translateY(-2px); background: var(--s2-gold); color: var(--s2-ink); }

.site-footer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #031b14, var(--s2-forest) 58%, #073a2d);
  color: #fff;
}
.site-footer::before { content: ''; display: block; height: 6px; background: linear-gradient(90deg, var(--s2-gold), var(--s2-lime), var(--s2-leaf), #65d5cf); }
.site-footer::after { content: ''; position: absolute; inset: 6px 0 auto; height: 260px; opacity: .12; background-image: radial-gradient(rgba(217, 249, 157, .7) 1px, transparent 1px); background-size: 30px 30px; mask-image: linear-gradient(to bottom, #000, transparent); pointer-events: none; }
.site-footer > .container { position: relative; z-index: 1; width: min(100% - 48px, 1500px); max-width: none; padding-top: 64px; }
.site-footer .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; margin-bottom: 54px; }
.site-footer .footer-grid > * { min-width: 0; height: 100%; padding: 28px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 24px; background: rgba(255, 255, 255, .035); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035); }
.site-footer .footer-brand-lockup { margin-bottom: 24px; }
.site-footer .footer-brand h2 { margin: 0 0 6px; color: #fff; font-size: clamp(1.15rem, 1.6vw, 1.55rem); line-height: 1.25; }
.site-footer .footer-brand .footer-institute { margin: 0; color: var(--s2-lime); font-size: 13px; font-weight: 700; line-height: 1.4; }
.site-footer .footer-brand small { color: rgba(255, 255, 255, .5); font-size: 11px; }
.site-footer .footer-brand .footer-intro,
.site-footer .footer-brand > p { margin: 0; color: rgba(255, 255, 255, .65); line-height: 1.75; text-align: justify; }
.site-footer :is(.footer-links, .footer-map) h4 { position: relative; margin-bottom: 22px; padding-bottom: 12px; color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.site-footer :is(.footer-links, .footer-map) h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 250px; max-width: 100%; height: 3px; border-radius: 999px; background: linear-gradient(90deg, var(--s2-gold), var(--s2-lime)); }
.site-footer .footer-links li { margin-bottom: 13px; color: rgba(255, 255, 255, .66); }
.site-footer .footer-links li a { position: relative; display: inline-block; padding-left: 16px; color: rgba(255, 255, 255, .62); line-height: 1.45; transition: color .3s ease, transform .3s ease; }
.site-footer .footer-links li a::before { content: '›'; position: absolute; left: 0; color: var(--s2-lime); }
.site-footer .footer-links li a:hover { color: #fff; transform: translateX(4px); }
.site-footer .footer-contact-list { display: grid; gap: 15px; }
.site-footer .footer-contact-list p { margin: 0; }
.site-footer .footer-contact-list strong { display: block; margin-bottom: 4px; color: var(--s2-lime); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.site-footer .footer-contact-list :is(span, a) { color: rgba(255, 255, 255, .66); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.site-footer .footer-map { display: flex; flex-direction: column; }
.site-footer .footer-map iframe { width: 100%; min-height: 230px; height: 100%; display: block; border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px; box-shadow: 0 18px 38px rgba(0, 0, 0, .28); filter: saturate(.78) contrast(.95); }
.site-footer .footer-bottom { position: relative; z-index: 1; border-top: 1px solid rgba(255, 255, 255, .1); background: rgba(0, 0, 0, .22); }
.site-footer .footer-bottom-flex { width: min(100% - 48px, 1500px); max-width: none; }
.site-footer .footer-bottom :is(p, a) { color: rgba(255, 255, 255, .62); }
.site-footer .footer-bottom a:hover { color: var(--s2-lime); }

@media (max-width: 1023px) {
  .site-footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .footer-grid > .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 639px) {
  .navbar .nav-container,
  .site-footer > .container,
  .site-footer .footer-bottom-flex { width: min(100% - 28px, 1500px); }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .site-footer .footer-grid > .footer-brand { grid-column: auto; }
  .site-footer .footer-grid > * { padding: 24px; }
  .site-footer .footer-map iframe { height: 260px; }
  .site-footer > .container,
  .site-footer .footer-bottom-flex { width: calc(100% - 24px); }
  .site-footer .footer-grid > * { padding: 20px; border-radius: 18px; }
}

/* Shared responsive safeguards for content-heavy pages */
.data-table-wrapper,
.table-responsive { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { min-width: 680px; }

:is(.data-table-wrapper, .table-responsive) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
iframe, video, canvas, svg { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }

@media (max-width: 639px) {
  .card { padding: 20px; }
  .section-title { overflow-wrap: anywhere; }
  .btn-primary, .btn-outline { white-space: normal; text-align: center; }
  .subpage-hero { padding: 64px 0 42px !important; }
  .subpage-hero h1 { margin-bottom: 16px !important; font-size: clamp(2rem, 10vw, 2.65rem) !important; }
  .subpage-hero p { font-size: 14px !important; }
  .section-spacer { height: 36px; }
  .navbar .nav-container { min-height: 68px; padding-block: 6px; }
  .navbar .brand-logo-wrapper { max-width: calc(100% - 48px); min-width: 0; gap: 7px; }
  .navbar .brand-logo-img { width: 42px; height: 42px !important; max-height: 42px; }
  .navbar .brand-logo-text { min-width: 0; font-size: 9.5px; line-height: 1.18; text-align: left; }
  .navbar .brand-logo-note { margin-top: 1px; font-size: 7.5px; text-align: left; }
  .navbar .hamburger { width: 40px; height: 40px; padding: 0; color: var(--s2-forest); }
  .navbar .nav-links { max-height: calc(100dvh - 68px); }
}

/* Global buttons — Sample 2 visual language */
:is(.btn-primary, .btn-outline, .registration-submit) {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  padding: 9px 17px;
  border: 1px solid rgba(6, 78, 59, .28) !important;
  border-radius: 9px !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  box-shadow: 0 7px 18px rgba(6, 78, 59, .1) !important;
  transform: none;
  transition: transform .25s ease, box-shadow .25s ease, color .25s ease, background-color .25s ease !important;
}

:is(.btn-primary, .registration-submit) {
  background: var(--s2-forest) !important;
  color: #fff !important;
}

.btn-outline {
  background: rgba(255, 255, 255, .82) !important;
  color: var(--s2-forest) !important;
}

:is(.btn-primary, .btn-outline, .registration-submit)::after {
  content: '';
  position: absolute;
  z-index: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--s2-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

:is(.btn-primary, .btn-outline, .registration-submit) > * { position: relative; z-index: 1; }

:is(.btn-primary, .btn-outline, .registration-submit):hover {
  transform: translateY(-3px);
  background: var(--s2-gold) !important;
  color: var(--s2-ink) !important;
  box-shadow: 0 13px 26px rgba(6, 78, 59, .2) !important;
}

:is(.btn-primary, .btn-outline, .registration-submit):hover::after { transform: scaleX(1); }
:is(.btn-primary, .btn-outline, .registration-submit):active { transform: translateY(0); box-shadow: 0 4px 10px rgba(6, 78, 59, .13) !important; }
:is(.btn-primary, .btn-outline, .registration-submit):focus-visible { outline: 3px solid rgba(16, 185, 129, .35); outline-offset: 3px; }

.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(6, 78, 59, .16) !important;
  border-radius: 10px !important;
  background: #eaf5e8 !important;
  color: var(--s2-forest) !important;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(6, 78, 59, .08);
  transition: transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease !important;
}

.btn-icon:hover {
  transform: translateY(-2px) rotate(-3deg);
  background: var(--s2-gold) !important;
  color: var(--s2-ink) !important;
  box-shadow: 0 10px 20px rgba(6, 78, 59, .16);
}

@media print {
  .site-footer { display: none !important; }
}

@media (max-width: 639px) {
  .site-header .header-inner { padding-inline: 14px; }
  .site-header .brand-logo-text { font-size: 10px; }
  .site-header .brand-logo-img { max-width: 46px; }
  .site-footer { padding-inline: 0; }
  .data-table { min-width: 620px; }
  .data-table :is(th, td) { padding: 10px; font-size: 11px; }
}
.admin-navbar .brand-logo-note {
  color: rgba(255, 255, 255, .72);
}
.admin-navbar .brand-logo-text {
  color: var(--white);
}
.auth-logo .brand-logo-wrapper {
  justify-content: center;
  margin-bottom: 24px;
}
.auth-logo .brand-logo-img {
  height: 60px;
}
.auth-logo .brand-logo-text {
  font-size: 16px;
}
/* Keep public navigation usable with touch, zoom and short landscape screens. */
.mobile-account-link { display: none; }
@media screen and (max-width: 1023px) {
  .navbar .nav-links { align-items: stretch; gap: 0; max-height: calc(100dvh - 90px); }
  .navbar .nav-links > li { width: 100%; }
  .navbar .nav-links :is(a, summary), .mobile-account-link button {
    display: flex; align-items: center; min-height: 44px; width: 100%;
    padding: 12px 16px; white-space: normal; text-align: left;
  }
  .navbar .mobile-account-link { display: block; }
  .mobile-account-link button {
    border: 0; background: transparent; color: var(--s2-ink);
    font: inherit; font-weight: 700; cursor: pointer;
  }
  .navbar .hamburger { color: var(--s2-forest); min-width: 44px; min-height: 44px; }
}
@media screen and (max-width: 639px) {
  .navbar .nav-links { max-height: calc(100dvh - 68px); }
  .auth-logo .brand-logo-wrapper { gap: 8px; }
  .auth-logo .brand-logo-img { height: 48px; flex-shrink: 0; }
  .auth-logo .brand-logo-text { font-size: 12px; }
}
@media (pointer: coarse) {
  :is(.btn-primary, .btn-outline, .btn-secondary, .btn-icon) { min-height: 44px; }
  .btn-icon { min-width: 44px; }
}
/* Avoid automatic input zoom on mobile Safari, including page-specific fields. */
@media screen and (max-width: 639px) {
  body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    font-size: 16px !important;
  }
}
