/* ── Slate Creator ── */
.sl-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Mode Toggle ── */

.sl-toggle {
  display: flex;
  background: #f1f1f4;
  border-radius: 0.75rem;
  padding: 4px;
  margin-bottom: 2.25rem;
}

.sl-toggle__btn {
  flex: 1;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #6e6e73;
  background: none;
  border: none;
  border-radius: 0.55rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sl-toggle__btn--active {
  color: #1d1d1f;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sl-toggle__btn:hover:not(.sl-toggle__btn--active) {
  color: #1d1d1f;
}

/* ── Errors ── */

.sl-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.65rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
}

.sl-errors--inline {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
}

.sl-errors p {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  color: #b91c1c;
  margin: 0;
  line-height: 1.5;
}

.sl-errors p + p { margin-top: 0.25rem; }

/* ── Section / Fieldset ── */

.sl-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 2.25rem;
}

.sl-fieldset:last-of-type { margin-bottom: 1.5rem; }

.sl-legend {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: #8a7860;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 1.25rem;
  padding: 0 0 0.7rem;
  width: 100%;
  border-bottom: 1px solid #ebe7df;
}

/* ── Fields ── */

.sl-field { margin-bottom: 1rem; }
.sl-field:last-child { margin-bottom: 0; }

.sl-row {
  display: flex;
  gap: 0.85rem;
}

.sl-field--half {
  flex: 1;
  min-width: 0;
}

.sl-label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #3a3a3f;
  margin-bottom: 0.4rem;
}

.sl-hint {
  font-family: 'Poppins', sans-serif;
  font-size: 0.73rem;
  color: #9a9a9f;
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

/* ── Form inputs (soft-fill style) ── */

.sl-form input[type="text"],
.sl-form input[type="email"],
.sl-form input[type="number"],
.sl-form select,
.sl-form textarea {
  width: 100%;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  color: #1d1d1f;
  padding: 0.7rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  outline: none;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
  background: #f4f4f6;
}

.sl-form input[type="text"]:hover:not(:focus),
.sl-form input[type="email"]:hover:not(:focus),
.sl-form input[type="number"]:hover:not(:focus),
.sl-form select:hover,
.sl-form textarea:hover:not(:focus) {
  background: #ededf0;
}

.sl-form input[type="text"]:focus,
.sl-form input[type="email"]:focus,
.sl-form input[type="number"]:focus,
.sl-form select:focus,
.sl-form textarea:focus {
  background: #fff;
  border-color: #1d1d1f;
  box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.07);
}

.sl-form input::placeholder,
.sl-form textarea::placeholder { color: #b0b0b5; }

.sl-form input[type="number"]::-webkit-outer-spin-button,
.sl-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sl-form input[type="number"] { -moz-appearance: textfield; }

.sl-form textarea {
  resize: vertical;
  min-height: 6.5rem;
}

.sl-form select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  padding-right: 2.4rem;
}

/* ── Project Wrapper ── */

.sl-project {
  margin-bottom: 1.5rem;
}

.sl-project:last-child {
  margin-bottom: 0;
}

/* ── Project Header (sits above the card) ── */



.sl-project__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0 0.25rem;
}

.sl-project__number {
  font-family: 'Poppins', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: #8a7860;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.sl-project__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.76rem;
  color: #9a9a9f;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #dcdce0;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.sl-project__remove:hover {
  color: #fff;
  background: #b91c1c;
  border-color: #b91c1c;
  transform: scale(1.05);
}

/* ── Project Card ── */

.sl-project__card {
  background: #fafafa;
  border: 1px solid #e8e8eb;
  border-radius: 0.85rem;
  padding: 1.4rem 1.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sl-project:hover .sl-project__card {
  border-color: #d8d8dd;
  box-shadow: 0 4px 16px -6px rgba(40, 50, 55, 0.08);
}

/* Inputs inside project cards: white so they sit clean on the off-white card */
.sl-project__card input[type="text"],
.sl-project__card input[type="email"],
.sl-project__card input[type="number"],
.sl-project__card select,
.sl-project__card textarea {
  background: #fff;
  border-color: rgba(40, 50, 55, 0.08);
}

.sl-project__card input[type="text"]:hover:not(:focus),
.sl-project__card input[type="email"]:hover:not(:focus),
.sl-project__card input[type="number"]:hover:not(:focus),
.sl-project__card select:hover,
.sl-project__card textarea:hover:not(:focus) {
  background: #fff;
  border-color: rgba(40, 50, 55, 0.18);
}

/* ── Add Project Button ── */

.sl-add-project {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6e6e73;
  background: transparent;
  border: 1.5px dashed #d6d6da;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  margin-top: 0.25rem;
}

.sl-add-project:hover {
  color: #1d1d1f;
  border-color: #1d1d1f;
  background: rgba(0, 0, 0, 0.015);
}

/* ── Submit ── */

.sl-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: #fff;
  background: #1d1d1f;
  border: none;
  border-radius: 0.75rem;
  padding: 0.95rem 1.5rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 10px 28px -10px rgba(40, 50, 55, 0.4);
  margin-top: 0.5rem;
}

.sl-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(40, 50, 55, 0.5);
}

.sl-submit:active:not(:disabled) { transform: translateY(0); }

.sl-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Responsive ── */

@media (max-width: 540px) {
  .sl-page {
    padding: 1.25rem 0.9rem 2.5rem;
  }

  .sl-toggle {
    margin-bottom: 1.5rem;
    padding: 3px;
  }

  .sl-toggle__btn {
    font-size: 0.78rem;
    padding: 0.5rem 0.75rem;
  }

  .sl-fieldset {
    margin-bottom: 1.5rem;
  }

  .sl-legend {
    font-size: 0.62rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.55rem;
    letter-spacing: 0.13em;
  }

  .sl-field {
    margin-bottom: 0.75rem;
  }

  .sl-label {
    font-size: 0.72rem;
    margin-bottom: 0.3rem;
  }

  /* Inputs stay at 16px (1rem) to prevent iOS zoom-on-focus,
     but padding tightens so fields feel compact */
  .sl-form input[type="text"],
  .sl-form input[type="email"],
  .sl-form input[type="number"],
  .sl-form select,
  .sl-form textarea {
    font-size: 1rem;
    padding: 0.55rem 0.8rem;
    border-radius: 0.55rem;
  }

  .sl-form textarea { min-height: 5rem; }

  .sl-row {
    flex-direction: column;
    gap: 0;
  }

  .sl-field--half { flex: none; }

  .sl-project {
    margin-bottom: 1.15rem;
  }

  .sl-project__header {
    margin-bottom: 0.5rem;
    padding: 0 0.15rem;
  }

  .sl-project__number {
    font-size: 0.6rem;
    letter-spacing: 0.13em;
  }

  .sl-project__remove {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }

  .sl-project__card {
    padding: 1rem 0.9rem;
    border-radius: 0.7rem;
  }

  .sl-add-project {
    font-size: 0.76rem;
    padding: 0.6rem 0.85rem;
  }

  .sl-submit {
    font-size: 0.84rem;
    padding: 0.8rem 1.25rem;
  }

  .sl-hint { font-size: 0.68rem; }
}