/* ── Open Letter Form — Front-end Styles ── */
:root {
  --olf-primary:   #2e7d32;
  --olf-accent:    #43a047;
  --olf-light:     #e8f5e9;
  --olf-border:    #c8e6c9;
  --olf-text:      #1b2631;
  --olf-muted:     #6b7280;
  --olf-error:     #c62828;
  --olf-radius:    10px;
  --olf-shadow:    0 4px 24px rgba(46,125,50,.12);
}

/* wrapper */
.olf-wrapper {
  max-width: 760px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--olf-shadow);
  overflow: hidden;
  font-family: 'SolaimanLipi', 'Noto Sans Bengali', 'Hind Siliguri', sans-serif;
}

/* header */
.olf-header {
  background: linear-gradient(135deg, #0d3b0f 0%, #1a6b1e 35%, #2e9e34 65%, #c8960c 100%);
  padding: 44px 40px 40px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.olf-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255,215,0,.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(255,255,255,.10) 0%, transparent 50%);
  pointer-events: none;
}
.olf-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ffd700, #ff8c00, #ffd700);
}
.olf-header-icon {
  font-size: 52px;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.35));
}
.olf-title {
  font-size: clamp(1.25rem, 3.2vw, 1.85rem);
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.4;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
  letter-spacing: .3px;
  position: relative;
}
.olf-subtitle {
  font-size: .97rem;
  opacity: .88;
  margin: 0;
  position: relative;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* form body */
#olf-form {
  padding: 36px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* field groups */
.olf-field-group { display: flex; flex-direction: column; gap: 6px; }
.olf-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* label */
.olf-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--olf-text);
}
.olf-label.required::after { content: " *"; color: var(--olf-error); }
.olf-optional { font-weight: 400; color: var(--olf-muted); font-size: .82rem; }

/* text / tel inputs */
.olf-input {
  border: 1.5px solid #d1d5db;
  border-radius: var(--olf-radius);
  padding: 10px 14px;
  font-size: .95rem;
  font-family: inherit;
  transition: border .2s, box-shadow .2s;
  background: #fafafa;
  color: var(--olf-text);
  width: 100%;
  box-sizing: border-box;
}
.olf-input:focus {
  outline: none;
  border-color: var(--olf-accent);
  box-shadow: 0 0 0 3px rgba(67,160,71,.15);
  background: #fff;
}

/* radio button group */
.olf-btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.olf-btn-group input[type="radio"] { display: none; }
.olf-radio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border: 2px solid #d1d5db;
  border-radius: 50px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
  background: #f9fafb;
  user-select: none;
}
.olf-radio-btn:hover { border-color: var(--olf-accent); background: var(--olf-light); }
.olf-btn-group input[type="radio"]:checked + .olf-radio-btn {
  border-color: var(--olf-primary);
  background: var(--olf-light);
  color: var(--olf-primary);
  box-shadow: 0 0 0 2px rgba(46,125,50,.2);
}

/* file upload */
.olf-upload-area {
  border: 2px dashed var(--olf-border);
  border-radius: var(--olf-radius);
  padding: 28px;
  text-align: center;
  background: var(--olf-light);
  cursor: pointer;
  transition: border .2s, background .2s;
  position: relative;
}
.olf-upload-area:hover { border-color: var(--olf-primary); background: #dcedc8; }
.olf-upload-icon { font-size: 36px; margin-bottom: 8px; }
.olf-upload-text { margin: 0 0 4px; font-weight: 600; color: var(--olf-text); }
.olf-upload-link { color: var(--olf-primary); text-decoration: underline; }
.olf-upload-hint { margin: 0; font-size: .82rem; color: var(--olf-muted); }
.olf-file-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* image previews */
.olf-preview-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.olf-preview-item {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--olf-border);
}
.olf-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.olf-preview-remove {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px; height: 22px;
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* letter textarea */
.olf-letter-group { gap: 8px; }
.olf-letter-icon { font-size: 1.1rem; }
.olf-letter-hint {
  font-size: .85rem;
  color: var(--olf-muted);
  margin: 0;
  line-height: 1.6;
  background: #f9fafb;
  border-left: 3px solid var(--olf-accent);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}
.olf-letter-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.olf-toolbar-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--olf-border);
  border-radius: 6px;
  background: var(--olf-light);
  font-size: .82rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--olf-primary);
  font-weight: 600;
  transition: background .2s;
}
.olf-toolbar-btn:hover { background: #c8e6c9; }
.olf-char-count { margin-left: auto; font-size: .82rem; color: var(--olf-muted); }
.olf-textarea {
  border: 1.5px solid #d1d5db;
  border-radius: var(--olf-radius);
  padding: 14px;
  font-size: .98rem;
  font-family: inherit;
  line-height: 1.8;
  resize: vertical;
  min-height: 260px;
  transition: border .2s, box-shadow .2s;
  background: #fafafa;
  color: var(--olf-text);
  width: 100%;
  box-sizing: border-box;
}
.olf-textarea:focus {
  outline: none;
  border-color: var(--olf-accent);
  box-shadow: 0 0 0 3px rgba(67,160,71,.15);
  background: #fff;
}

/* terms */
.olf-terms-group { gap: 10px; }
.olf-terms-box {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--olf-radius);
  padding: 16px 18px;
  font-size: .88rem;
  color: var(--olf-muted);
  line-height: 1.9;
  max-height: 200px;
  overflow-y: auto;
}
.olf-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .92rem;
  color: var(--olf-text);
  font-weight: 500;
}
.olf-checkbox-label input[type="checkbox"] { display: none; }
.olf-checkbox-custom {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all .2s;
  background: #fff;
}
.olf-checkbox-label input:checked + .olf-checkbox-custom {
  background: var(--olf-primary);
  border-color: var(--olf-primary);
}
.olf-checkbox-label input:checked + .olf-checkbox-custom::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* messages */
#olf-messages { display: flex; flex-direction: column; gap: 8px; }
.olf-error-msg, .olf-success-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .9rem;
}
.olf-error-msg   { background: #fdecea; border: 1px solid #f5c6cb; color: var(--olf-error); }
.olf-success-msg { background: var(--olf-light); border: 1px solid var(--olf-border); color: var(--olf-primary); }

/* submit */
.olf-submit-wrap { text-align: center; margin-top: 8px; }
.olf-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 48px;
  background: linear-gradient(135deg, var(--olf-primary), var(--olf-accent));
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 16px rgba(46,125,50,.35);
  min-width: 200px;
  justify-content: center;
}
.olf-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,125,50,.45);
}
.olf-submit-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* responsive */
@media (max-width: 600px) {
  .olf-header   { padding: 28px 20px; }
  #olf-form     { padding: 24px 18px; }
  .olf-field-row { grid-template-columns: 1fr; }
}

/* drag-over state */
.olf-upload-area.olf-drag-over {
  border-color: var(--olf-primary);
  background: #c8e6c9;
}
/* disabled upload */
.olf-upload-area.olf-upload-disabled {
  opacity: .5;
  pointer-events: none;
}
