:root{
  --premium-border: rgba(255,255,255,.12);
  --premium-glow: rgba(88,166,255,.35);
  --premium-glow-2: rgba(139,92,246,.25);
}

/* =========================
   Premium card shell
========================= */

.premium-card{
  position:relative;
  overflow:hidden;
  height:auto !important;
  align-self:start;
}

.premium-card::before{
  content:"";
  position:absolute;
  inset:-1px;
  background:
    radial-gradient(900px 280px at 20% 0%, var(--premium-glow), transparent 60%),
    radial-gradient(700px 240px at 90% 20%, var(--premium-glow-2), transparent 60%);
  opacity:.30;
  pointer-events:none;
}

.premium-card > *{
  position:relative;
  z-index:1;
}

/* =========================
   Banner
========================= */

.premium-banner{
  margin-top:16px;
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px 14px;
  border:1px solid var(--premium-border);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-radius:16px;
  backdrop-filter: blur(10px);
}

.banner-icon{
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid var(--premium-border);
  background:rgba(255,255,255,.05);
  display:grid;
  place-items:center;
}

.banner-icon svg{
  width:18px;
  height:18px;
  fill:rgba(230,237,243,.9);
}

/* =========================
   Card header
========================= */

.card-head{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:start;
}

.card-head > div:first-child{
  min-width:0;
}

.card-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--premium-border);
  background:rgba(255,255,255,.05);
  color:rgba(230,237,243,.85);
  font-size:12px;
  white-space:nowrap;
}

.card-badge .dot{
  width:8px;
  height:8px;
  border-radius:99px;
  background:rgba(88,166,255,.9);
  box-shadow:0 0 0 6px rgba(88,166,255,.15);
}

/* =========================
   Form grid
========================= */

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.span-2{ grid-column:span 2; }

/* =========================
   Floating fields (FIXED + Safari-safe)
========================= */

.field{
  position:relative;
  overflow:visible;
}

/* Give the input enough top padding for the label,
   and enough bottom room so hint never visually collides */
.field input,
.field textarea{
  width:100%;
  padding:26px 14px 12px; /* ↑ more top space for label */
  border-radius:16px;
  border:1px solid rgba(255,255,255,.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  color:var(--text);
  outline:none;
  transition: border-color .15s ease,
              background .15s ease,
              box-shadow .15s ease,
              transform .12s ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 6px 18px rgba(0,0,0,.18);
  margin:0; /* keep clean */
}

.field textarea{
  resize:vertical;
  min-height:140px;
  padding-top:28px;
}

.field input:focus,
.field textarea:focus{
  border-color:rgba(88,166,255,.65);
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
  box-shadow:
    0 0 0 4px rgba(88,166,255,.16),
    0 10px 26px rgba(88,166,255,.12);
  transform:translateY(-1px);
}
.field input:focus-visible,
.field textarea:focus-visible{
  outline:2px solid rgba(88,166,255,.55);
  outline-offset:2px;
}
.field input::placeholder,
.field textarea::placeholder{
  color:rgba(230,237,243,.38);
}

/* Label INSIDE the input */
.field label{
  position:absolute;
  left:14px;
  top:16px;
  font-size:14px;
  line-height:1;
  color:rgba(230,237,243,.70);
  pointer-events:none;
  transition:all .15s ease;
  z-index:2;
}

/* Textareas: start label slightly higher */
.field textarea + label{
  top:14px;
}

/* Floating state: shrink label and keep it INSIDE the input */
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label{
  top:8px;              /* ← key Safari-safe position */
  font-size:11px;
  color:rgba(230,237,243,.90);
}

/* =========================
   Helper / hint text (FIXED)
========================= */

.hint{
  display:block;
  margin:10px 2px 0;
  font-size:12px;
  line-height:1.45;
  color:rgba(230,237,243,.70);
}

/* Ensure hint always starts below the field */
.field label + .hint{
  margin-top:12px;
}

/* Notes row */
.hint-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:8px;
}

.charcount{
  font-size:12px;
  color:rgba(230,237,243,.55);
  border:1px solid rgba(255,255,255,.10);
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.04);
}

/* =========================
   Quick links
========================= */

.quick-links{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.mini-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:rgba(230,237,243,.92);
  font-size:13px;
}

.mini-link:hover{
  text-decoration:none;
  background:rgba(255,255,255,.06);
}

.mini-ico{
  width:22px;
  height:22px;
  border-radius:10px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
}

.mini-ico svg{
  width:14px;
  height:14px;
  fill:rgba(230,237,243,.92);
}

/* =========================
   Section titles
========================= */

.form-section-title{
  margin:2px 2px 10px;
  font-weight:700;
  color:rgba(230,237,243,.92);
}

/* =========================
   Pills
========================= */

.pill-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}

.pill{
  position:relative;
  cursor:pointer;
}

.pill input{
  position:absolute;
  opacity:0;
}

.pill span{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(230,237,243,.88);
  font-weight:600;
  font-size:13px;
}

.pill:hover span{
  background:rgba(255,255,255,.06);
}

.pill input:checked + span{
  background:linear-gradient(135deg,
    rgba(88,166,255,.22),
    rgba(139,92,246,.18));
  border-color:rgba(88,166,255,.45);
  box-shadow:0 0 0 4px rgba(88,166,255,.12);
}

/* =========================
   CTA
========================= */

.premium-cta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:18px;
}

.premium-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border:none;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}

.premium-secondary{
  border:1px solid rgba(255,255,255,.12);
}

.btn-ico{
  width:22px;
  height:22px;
  border-radius:12px;
  background:rgba(11,16,32,.25);
  border:1px solid rgba(255,255,255,.10);
  display:grid;
  place-items:center;
}

.btn-ico svg{
  width:14px;
  height:14px;
  fill:rgba(230,237,243,.92);
}

.microcopy{
  margin-top:12px;
  font-size:12px;
  color:rgba(230,237,243,.75);
}

/* =========================
   Layout tweaks
========================= */

.premium-hero{ padding-top:0; }

/* =========================
   Mobile
========================= */

@media (max-width:720px){
  .form-grid{ grid-template-columns:1fr; }
  .span-2{ grid-column:span 1; }
  .pill-grid{ grid-template-columns:repeat(2,1fr); }
}

@media (max-width:640px){
  .card-head{ grid-template-columns:1fr; }
  .card-badge{ margin-top:6px; }
}
/* ===== Safari-only final layout guard ===== */
@supports (-webkit-touch-callout: none) {

  /* Prevent Safari from collapsing line-height calculations */
  .field label {
    line-height: 1.1;
  }

  /* Force hint text to stay below inputs */
  .field .hint,
  .hint-row {
    position: relative;
    top: 0;
  }

  /* Safari sometimes miscalculates grid row heights */
  .form-grid {
    align-items: start;
  }

  /* Prevent subtle text overlap at certain zoom levels */
  .field input,
  .field textarea {
    font-feature-settings: "kern" 1;
  }
}
