:root{
  --green: #12823b;         /* main */
  --green-ink: #0b5a29;     /* darker lines */
  --mint: #a8f0c6;          /* accent */
  --beige: #f3e9d2;         /* accent */
  --ink: #111111;           /* brutalist outlines */
  --paper: #ffffff;
  --paper: #ffffff;
  --grey:  #A9A9A9;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  background: var(--beige);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-weight: 700; /* chunky */
  letter-spacing: 0.2px;
}

/* Layout shell: fills the viewport and avoids desktop scrolling */
.shell{
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: clamp(12px, 1.8vw, 18px);
}



/* Neo-brutalist header */
header{
  background: var(--mint);
  color: var(--ink);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 0 var(--ink);
  padding: clamp(10px, 1.8vw, 16px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.brand{
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand h1{
  margin: 0;
  font-size: clamp(24px, 3.5vw, 40px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.brand a {
    text-decoration: inherit;
    color: inherit;
    cursor: auto;
    background: none;
}
.brand a:hover {
    text-decoration: inherit;
    color: inherit;
    cursor: auto;
    background: none;
}
.brand a:focus {
    text-decoration: inherit;
    color: inherit;
    cursor: auto;
    background: none;
}
.brand a:visited {
    text-decoration: inherit;
    color: inherit;
    cursor: auto;
    background: none;
}

.tag{
  font-size: clamp(12px, 1.5vw, 16px);
  padding: 6px 10px;
  background: var(--mint);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 0 var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
}

a{
  color: var(--ink);
  text-decoration-color: var(--ink);
}
a:hover,
a:focus{
  color: var(--green-ink);
  background: none;
  text-decoration-color: transparent;
  outline: none;
  transition: background 120ms ease;
}

/* Content row: card centered; no desktop scroll */
main{
  display: grid;
  place-items: center;
}

.card{
  width: min(100%, 1430px);
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0 0 var(--ink);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

/* Left panel: loud title + bullets */
.card-aside{
  background: var(--mint);
  border-right: 4px solid var(--ink);
  padding: clamp(14px, 2vw, 22px);
  display: grid;
  align-content: start;
  gap: 16px;
}
.card-aside h2{
  margin: 0 0 6px 0;
  font-size: clamp(18px, 2.4vw, 26px);
  text-transform: uppercase;
}
.bullets{
  display: grid;
  gap: 10px;
}
.pill{
  background: var(--beige);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  box-shadow: 4px 4px 0 0 var(--ink);
  font-size: clamp(12px, 1.4vw, 14px);
}

.error{
  color: #F08080;
  font-size: clamp(10px, 1.4vw, 12px);
}

/* Form side */
form{
  padding: clamp(14px, 2vw, 22px);
  display: grid;
  gap: 12px;
}

@media (min-width: 992px) {
  form {
    gap: 20px;
  }
}

.group{
  display: grid;
  gap: 6px;
}

label{
  text-transform: uppercase;
  font-size: 12px;
}
.label-hint{
  text-transform: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 6px;
  color: #444;
}
.password-group input{
  letter-spacing: 0.3px;
}
.field-note{
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  text-transform: none;
}
input.form-control, textarea.form-control, select.form-select{
  border: 3px solid var(--ink) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: var(--ink) !important;
  box-shadow: 4px 4px 0 0 var(--ink);
  padding: 10px 12px;
  font-weight: 700;
}
input::placeholder, textarea::placeholder{ color:#666; font-weight:600; }

.row-lite{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.btn-primary{
  --btn-bg: var(--mint);
  --btn-ink: var(--ink);
  background: var(--btn-bg) !important;
  color: var(--btn-ink) !important;
  border: 3px solid var(--ink) !important;
  border-radius: 0 !important;
  padding: 12px 18px !important;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: 6px 6px 0 0 var(--ink);
}
.btn-primary:active{
  transform: translate(2px,2px);
  box-shadow: 4px 4px 0 0 var(--ink);
}
.btn-primary:hover{
  background: var(--beige) !important;
}

/* Desktop: force no scrolling by constraining height */
@media (min-width: 992px){
  html, body{ overflow: hidden; } /* no desktop scroll */
  main{
    /* Ensure card stays within viewport minus header & gaps */
    min-height: 0; /* allow grid to size properly */
  }
  .card{
    height: calc(100vh - (clamp(10px, 1.8vw, 16px) * 2 + clamp(24px, 3.5vw, 40px)) - 48px);
    /* The above keeps card within viewport; tuned for header size & grid gap */
    max-height: 990px; /* safety cap on huge screens */
  }
  .card.auth-card{
    height: auto;
    max-height: none;
  }
  form{
    overflow: hidden; /* prevent accidental scrollbars */
  }
}

/* Tablets & phones */
@media (max-width: 991.98px){
  html, body{ overflow: auto; } /* allow mobile scrolling */
  .shell{
    padding: clamp(18px, 6vw, 32px); /* breathe more on mobile */
  }
  header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
  }
  .brand{
    flex: 1 1 auto;
  }
  .tag{
    margin-left: auto;
    white-space: nowrap;
  }
  .card{
    grid-template-columns: 1fr;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
  }
  .card-aside{
    display: none; /* hide the marketing aside on mobile to focus on the form */
  }
  .row-lite{
    grid-template-columns: 1fr;
  }
}

/* Very small phones */
@media (max-width: 420px){
  .tag{ display: none; }
}

/* Auth card - compact centered card for password prompts */
.card.auth-card {
  grid-template-columns: 1fr;
  width: min(100%, 380px);
  height: auto;
  max-height: none;
}

.card.auth-card form {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(14px, 2vw, 22px);
  gap: 12px;
}

.card.auth-card .group {
  width: 100%;
}

.card.auth-card .auth-title {
  margin: 0;
  font-size: 18px;
  text-transform: uppercase;
}

.card.auth-card .auth-input {
  padding: 8px 10px;
}

.card.auth-card .auth-btn {
  padding: 8px 14px;
  width: auto;
}

/* Edit card - wider card for edit forms after authentication */
.card.edit-card {
  grid-template-columns: 1fr;
  width: min(100%, 580px);
  height: auto;
  max-height: none;
}

/* Event page styles */
.event-card {
  width: min(100%, 1400px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-pane {
  padding: clamp(18px, 2vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.event-pane {
  background: var(--mint);
  border-right: 4px solid var(--ink);
}

.guest-pane {
  background: var(--paper);
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.event-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 40px);
  text-transform: uppercase;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.info-block {
  border: 3px solid var(--ink);
  padding: 12px;
  background: var(--paper);
  box-shadow: 6px 6px 0 0 var(--ink);
  display: grid;
  gap: 4px;
}

.info-label {
  font-size: 12px;
  text-transform: uppercase;
  color: #333;
}

.info-value {
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.event-description {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  max-width: 496px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.guest-header {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.guest-header h2 {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 28px);
  text-transform: uppercase;
}

.guest-count {
  padding: 6px 12px;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 0 var(--ink);
  background: var(--beige);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.1em;
}

.guest-list-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.guest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guest-card {
  border: 3px solid var(--ink);
  padding: 10px;
  box-shadow: 6px 6px 0 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guest-note-meta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.guest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.guest-edit-meta {
  display: flex;
  display: inline;
  margin-top: auto;
}

.guest-edit-text {
  font-size: 9px;
  margin: 0;
  padding: 0;
}

.guest-edit-anchor {
  color: var(--grey);
  text-decoration: inherit;
}

.guest-edit-anchor:hover, .guest-edit-anchor:focus {
  color: var(--green-ink);
  background: none;
}

.guest-pill {
  border: 3px solid var(--ink);
  padding: 4px 8px;
  background: var(--mint);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  box-shadow: 4px 4px 0 0 var(--ink);
}

.guest-name {
  font-size: 16px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.guest-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  flex: 1 1 auto;
}

.guest-card.empty {
  text-align: center;
  background: var(--beige);
}

.rsvp-form {
  margin-top: 24;
  border: 3px solid var(--ink);
  padding: 14px;
  background: var(--paper);
  box-shadow: 6px 6px 0 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.rsvp-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  text-transform: uppercase;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

@media (max-width: 580px) {
  .form-grid-3col {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.form-input {
  border: 3px solid var(--ink);
  padding: 8px;
  font-size: 14px;
  background: #fff;
  box-shadow: 4px 4px 0 0 var(--ink);
}

.form-field-centered .info-label {
  text-align: center;
}

.optional-note {
  font-size: 11px;
  text-transform: none;
  letter-spacing: normal;
  color: #333;
}

.rsvp-choices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.choice-wrapper {
  position: relative;
}

.choice-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-label {
  border: 3px solid var(--ink);
  padding: 8px 18px;
  background: var(--mint);
  box-shadow: 4px 4px 0 0 var(--ink);
  text-transform: uppercase;
  font-size: 13px;
  cursor: pointer;
  display: inline-block;
}

.choice-input:checked + .choice-label {
  background: var(--beige);
}

.edit-button-meta {
  margin-top: auto;
}

.edit-button {
  border: 3px solid var(--ink);
  background: var(--beige);
  text-transform: uppercase;
  font-weight: bold;
  padding: 10px;
  font-size: 15px;
  box-shadow: 6px 6px 0 0 var(--ink);
  cursor: pointer;
  align-self: center;
}

.edit-button:active {
  box-shadow: 4px 4px 0 0 var(--ink);
  transform: translate(2px, 2px);
}

.edit-button:hover {
  background: var(--paper);
}

.submit-button {
  border: 3px solid var(--ink);
  background: var(--mint);
  text-transform: uppercase;
  font-weight: bold;
  padding: 10px;
  font-size: 15px;
  box-shadow: 6px 6px 0 0 var(--ink);
  cursor: pointer;
  align-self: center;
}

.submit-button:active {
  box-shadow: 4px 4px 0 0 var(--ink);
  transform: translate(2px, 2px);
}

.submit-button:hover {
  background: var(--beige);
}

.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.delete-button {
  border: 3px solid var(--ink);
  background: #e74c3c;
  color: white;
  text-transform: uppercase;
  font-weight: bold;
  padding: 10px;
  font-size: 15px;
  box-shadow: 6px 6px 0 0 var(--ink);
  cursor: pointer;
}

.delete-button:active {
  box-shadow: 4px 4px 0 0 var(--ink);
  transform: translate(2px, 2px);
}

.delete-button:hover {
  background: #c0392b;
}

@media (min-width: 992px) {
  .guest-pane {
    max-height: calc(100vh - 100px);
  }
}

@media (max-width: 991.98px) {
  .event-pane {
    border-right: none;
    border-bottom: 4px solid var(--ink);
  }

  .guest-list {
    max-height: none;
  }
}
