/* ============================================================
   SwaamLab Forms — Touch-friendly, accessible form controls
   ============================================================ */

.form-card {
  max-width: 680px;
  margin: 0 auto;
}

.field {
  margin-bottom: 1.15rem;
}

label.lbl, .lbl {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.req {
  color: var(--danger);
  margin-left: 2px;
}

input[type=text],
input[type=email],
input[type=number],
input[type=date],
input[type=password],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  padding-right: 2.3rem;
}

[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input.invalid, select.invalid, textarea.invalid {
  border-color: var(--danger);
}

input.invalid:focus, select.invalid:focus {
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.hint {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 0.35rem;
}

.err {
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 0.35rem;
  font-weight: 500;
  display: none;
}

.err.show {
  display: block;
}

/* Amount Input Wrapper with Rupee Symbol */
.amount-wrap {
  position: relative;
}

.amount-wrap .cur {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-2);
  pointer-events: none;
}

.amount-wrap input {
  padding-left: 2.25rem;
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

/* Search Select Person Picker */
.search-select {
  position: relative;
}

.search-select input {
  margin-bottom: 0.35rem;
}

.option-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.option-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s ease;
}

.option-list button:last-child {
  border-bottom: none;
}

.option-list button:hover,
.option-list button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* File Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropzone:hover,
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone input {
  display: none;
}

.dropzone-icon {
  color: var(--accent);
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: center;
}

.dropzone-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
}

.dropzone-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 0.2rem;
}

/* Uploaded File Meta Card */
.file-meta {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  margin-top: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.file-meta .preview-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.file-meta .preview-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-2);
  flex-shrink: 0;
}

.file-meta .grow {
  flex: 1;
  min-width: 0;
}

.file-meta .nm {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  word-break: break-all;
}

.file-meta .sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 0.15rem;
}

/* Form Action Bar */
.form-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 1rem 0 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
  z-index: 10;
}
