/* Application form. Dense form layout that respects the unified
   --lf-* tokens and is touch-friendly (≥44px hit targets). */

.apl-root {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.apl-head { margin-bottom: 24px; }

.apl-back {
  display: inline-block;
  font-size: 13px;
  color: var(--lf-text-muted);
  text-decoration: none;
  margin-bottom: 16px;
}
.apl-back:hover { color: var(--lf-accent); }

.apl-head h1 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--lf-text);
}

.apl-sub {
  font-size: 14px;
  color: var(--lf-text-muted);
  margin: 0;
  line-height: 1.5;
}

.apl-form { display: flex; flex-direction: column; gap: 24px; }

.apl-section {
  background: var(--lf-panel);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius, 12px);
  padding: 20px 24px;
  margin: 0;
}

.apl-section legend {
  font-size: 14px;
  font-weight: 600;
  padding: 0 8px;
  color: var(--lf-text);
}

.apl-help {
  font-size: 13px;
  color: var(--lf-text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.apl-help strong { color: var(--lf-text); font-weight: 600; }

.apl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.apl-grid label,
.apl-section > label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--lf-text-muted);
  gap: 6px;
}

.apl-grid-wide { grid-column: 1 / -1; }

.apl-req { color: var(--lf-error); margin-left: 2px; }

.apl-form input[type="text"],
.apl-form input[type="email"],
.apl-form input[type="tel"],
.apl-form input[type="url"],
.apl-form select,
.apl-form textarea {
  background: var(--lf-input-bg);
  color: var(--lf-text);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius-sm, 8px);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
}

.apl-form textarea {
  resize: vertical;
  min-height: 100px;
}

.apl-form input:focus-visible,
.apl-form select:focus-visible,
.apl-form textarea:focus-visible {
  outline: 2px solid var(--lf-accent);
  outline-offset: 1px;
  border-color: var(--lf-accent);
}

.apl-checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
}

.apl-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--lf-text);
  padding: 6px 4px;
  cursor: pointer;
  min-height: 36px;
}

.apl-check input { margin: 0; flex-shrink: 0; }

.apl-files {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apl-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apl-file-empty {
  font-size: 13px;
  color: var(--lf-text-muted);
  font-style: italic;
}

.apl-file-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  background: var(--lf-bg);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius-sm, 8px);
  padding: 8px 12px;
  font-size: 13px;
}

.apl-file-name {
  font-weight: 500;
  color: var(--lf-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apl-file-meta {
  color: var(--lf-text-muted);
  font-size: 12px;
}

.apl-file-pending { color: var(--lf-text-muted); }
.apl-file-up { color: var(--lf-info); }
.apl-file-ok { color: var(--lf-success); }
.apl-file-err { color: var(--lf-error); }

.apl-file-remove {
  background: transparent;
  border: 1px solid var(--lf-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  color: var(--lf-text-muted);
  cursor: pointer;
  line-height: 1;
}
.apl-file-remove:hover {
  border-color: var(--lf-error);
  color: var(--lf-error);
}

.apl-form-error {
  background: var(--lf-error-bg);
  border: 1px solid var(--lf-error-border);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 16px;
  color: var(--lf-error);
  font-size: 13px;
}

.apl-form-actions {
  display: flex;
  justify-content: flex-end;
}

.apl-btn {
  font: inherit;
  padding: 12px 24px;
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 44px;
}

.apl-btn-primary {
  background: var(--lf-accent);
  color: var(--lf-bg);
  border-color: var(--lf-accent);
}
.apl-btn-primary:hover {
  background: var(--lf-accent-hover);
  border-color: var(--lf-accent-hover);
}

.apl-btn-secondary {
  background: var(--lf-panel);
  color: var(--lf-text);
  border-color: var(--lf-border);
}
.apl-btn-secondary:hover {
  background: var(--lf-panel-hover);
}

.apl-btn:focus-visible {
  outline: 2px solid var(--lf-accent);
  outline-offset: 2px;
}

.apl-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.apl-fineprint {
  font-size: 12px;
  color: var(--lf-text-muted);
  margin: 0;
  line-height: 1.5;
  text-align: center;
}

/* Success state */
.apl-success-card {
  text-align: center;
  background: var(--lf-panel);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius, 12px);
  padding: 48px 32px;
}

.apl-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--lf-success-bg);
  border: 1px solid var(--lf-success-border);
  color: var(--lf-success);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 24px;
}

.apl-success-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--lf-text);
}

.apl-success-card p {
  font-size: 15px;
  color: var(--lf-text-muted);
  margin: 0 auto 16px;
  max-width: 480px;
  line-height: 1.55;
}

.apl-success-card a {
  color: var(--lf-accent);
}

.apl-success-note { font-size: 13px; }

.apl-cta {
  display: inline-block;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--lf-border);
  color: var(--lf-text);
  background: transparent;
}
.apl-cta:hover { border-color: var(--lf-accent); color: var(--lf-accent); }
