@charset "utf-8";
/* CSS Document */

/* File: /assets/css/tw7-forms.css
   Version: v1.0
   Purpose: Polished, accessible TW7 form styling without GOV.UK.
*/

:root{
  --tw7-bg: #f6f7fb;
  --tw7-card: #ffffff;
  --tw7-border: #e2e4ea;
  --tw7-text: #1f2532;
  --tw7-muted: #6b7280;
  --tw7-accent: #7b4ac7;      /* TW7 accent */
  --tw7-accent-2: #a853b3;    /* alt accent option */
  --tw7-accent-hover: #6937b6;
  --tw7-danger: #d43e2a;
  --tw7-success: #2e8540;
  --tw7-shadow: 0 8px 24px rgba(20, 24, 31, .06);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

html, body { color: var(--tw7-text); background: var(--tw7-bg); }

.tw7-container{
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

.tw7-h1{
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.25rem);
  line-height: 1.2;
  margin: .2rem 0 .4rem;
  letter-spacing: -0.01em;
}
.tw7-h2{
  font-size: 1.15rem;
  margin: .25rem 0 .75rem;
}
.tw7-lead{
  color: var(--tw7-muted);
  margin: 0 0 1rem;
}

/* Grid */
.tw7-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 920px){
  .tw7-grid{
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

.tw7-col-main, .tw7-col-side{ min-width: 0; }

/* Card */
.tw7-card{
  background: var(--tw7-card);
  border: 1px solid var(--tw7-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--tw7-shadow);
  padding: 1.2rem;
}

/* Form */
.tw7-form{ display: grid; gap: 1rem; }

.tw7-label{
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
}
.tw7-hint{
  font-size: .95rem;
  color: var(--tw7-muted);
  margin-bottom: .4rem;
}

.tw7-field{ }
.tw7-field--error .tw7-input,
.tw7-field--error .tw7-select,
.tw7-field--error .tw7-textarea{
  border-color: var(--tw7-danger);
  background: #fff7f7;
}
.tw7-error{
  color: var(--tw7-danger);
  margin: .25rem 0 .35rem;
  font-size: .95rem;
}

/* Inputs */
.tw7-input,
.tw7-select,
.tw7-textarea{
  width: 100%;
  font: inherit;
  color: var(--tw7-text);
  background: #fff;
  border: 1px solid var(--tw7-border);
  border-radius: var(--radius-md);
  padding: .7rem .85rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-sizing: border-box;
}

.tw7-input:focus,
.tw7-select:focus,
.tw7-textarea:focus{
  border-color: var(--tw7-accent);
  box-shadow: 0 0 0 3px rgba(123, 74, 199, .22);
}

/* Checkbox */
.tw7-check{
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: .6rem;
  align-items: start;
}
.tw7-check__input{
  width: 18px; height: 18px;
  accent-color: var(--tw7-accent);
  margin-top: .15rem;
}
.tw7-check__label{ line-height: 1.35; }

/* Inset */
.tw7-inset{
  background: #f9f7ff;
  border: 1px dashed var(--tw7-border);
  border-radius: var(--radius-md);
  padding: .85rem;
  color: var(--tw7-muted);
}

/* Buttons */
.tw7-btn{
  display: inline-flex;
  align-items: center; justify-content: center;
  padding: .7rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  user-select: none;
}
.tw7-btn--pill{ border-radius: 999px; }

.tw7-btn--primary{
  background: var(--tw7-accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(123,74,199,.24);
}
.tw7-btn--primary:hover{ background: var(--tw7-accent-hover); }
.tw7-btn--primary:active{ transform: translateY(1px); }

/* Banners */
.tw7-banner{
  border-radius: var(--radius-lg);
  padding: .9rem 1rem;
  border: 1px solid var(--tw7-border);
  background: #fff;
  box-shadow: var(--tw7-shadow);
  margin: 0 0 1rem;
}
.tw7-banner--error{
  border-color: #f0c1ba;
  background: #fff2f0;
}
.tw7-banner--success{
  border-color: #c1e1cc;
  background: #eefbef;
}

/* Lists and links */
.tw7-list{ margin: .4rem 0 0 .95rem; }
.tw7-list li{ margin: .2rem 0; }
.tw7-link{ color: var(--tw7-accent); text-decoration: underline; }
.tw7-link:hover{ color: var(--tw7-accent-hover); }

/* Details */
.tw7-details{
  border: 1px solid var(--tw7-border);
  border-radius: var(--radius-md);
  background: #fff;
  margin: 0 0 .9rem;
}
.tw7-details__summary{
  cursor: pointer;
  list-style: none;
  padding: .7rem .9rem;
  font-weight: 600;
}
.tw7-details__summary::-webkit-details-marker{ display: none; }
.tw7-details__content{
  border-top: 1px solid var(--tw7-border);
  padding: .8rem .9rem;
}

/* Sidebar help card */
.tw7-help{ display: grid; gap: .6rem; }

/* Character counter */
.tw7-count{
  text-align: right;
  font-size: .9rem;
  color: var(--tw7-muted);
  margin-top: .25rem;
}
.tw7-count.tw7-count--near{ color: #b26a00; }   /* amber near limit */
.tw7-count.tw7-count--limit{ color: var(--tw7-danger); }

/* Utilities */
.tw7-hidden{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
