/* =========================================================
   کفش ایوان | E1Shoes — استایل فرم‌ها و ورودی‌ها v2
   ========================================================= */

/* ============ FORM WRAPPER ============ */
.form-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
}

@media (min-width: 600px) {
  .form-wrap { padding: 36px 32px; }
}

/* ============ INPUTS ============ */
.input,
.textarea,
.select {
  width: 100%;
  padding: 13px 16px;
  font-size: .95rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
  opacity: .8;
}

.input:hover:not(:disabled),
.textarea:hover:not(:disabled),
.select:hover:not(:disabled) {
  border-color: #d4d4d8;
}

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

.input:disabled,
.textarea:disabled,
.select:disabled {
  background: var(--bg-soft);
  color: var(--text-muted);
  cursor: not-allowed;
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--danger);
}
.input[aria-invalid="true"]:focus,
.textarea[aria-invalid="true"]:focus,
.select[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(220,38,38,.15);
}

.textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.7;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 16px;
  padding-left: 40px;
  cursor: pointer;
}

/* ============ CHECKBOX & RADIO ============ */
.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .92rem;
  color: var(--text-soft);
  user-select: none;
  padding: 4px 0;
}

.checkbox input,
.radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

/* ============ FORM LAYOUT ============ */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 600px) {
  .form-row.two-cols { grid-template-columns: repeat(2, 1fr); }
  .form-row.three-cols { grid-template-columns: repeat(3, 1fr); }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}

.form-label .req {
  color: var(--danger);
  margin-right: 3px;
}

.form-hint {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.form-error {
  font-size: .8rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -2px;
}
.form-error::before { content: '⚠'; font-size: .9rem; }

/* ============ FORM ACTION ============ */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.form-actions .btn {
  min-width: 160px;
}

@media (max-width: 500px) {
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
}

/* ============ ALERT MESSAGES ============ */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: .92rem;
  line-height: 1.75;
  margin-bottom: 20px;
  border-right: 4px solid;
}

.alert-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.alert-success {
  background: var(--success-soft);
  color: #065f46;
  border-color: var(--success);
}

.alert-error {
  background: var(--danger-soft);
  color: #991b1b;
  border-color: var(--danger);
}

.alert-warning {
  background: var(--warning-soft);
  color: #92400e;
  border-color: var(--warning);
}

.alert-info {
  background: var(--info-soft);
  color: #1e40af;
  border-color: var(--info);
}

/* ============ SEARCH BAR ============ */
.search-form {
  display: flex;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.search-form .input {
  flex: 1;
  min-width: 0;
}

.search-form .btn {
  flex-shrink: 0;
  padding-left: 22px;
  padding-right: 22px;
}

@media (max-width: 500px) {
  .search-form { flex-direction: column; }
  .search-form .btn { width: 100%; }
}

/* ============ NEWSLETTER ============ */
.newsletter {
  padding: 40px 24px;
  background: linear-gradient(135deg, #1a1a1f 0%, #2a2a32 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.newsletter::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at 70% 30%, rgba(255,90,31,.3), transparent 45%);
  pointer-events: none;
  z-index: -1;
}

.newsletter h3 {
  position: relative;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

.newsletter p {
  position: relative;
  color: #c7c7ce;
  font-size: .92rem;
  max-width: 480px;
  margin: 0 auto 22px;
}

.newsletter-form {
  position: relative;
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter-form .input {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
  color: #fff;
}

.newsletter-form .input::placeholder { color: rgba(255,255,255,.5); }

.newsletter-form .input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,.12);
}

.newsletter-note {
  position: relative;
  font-size: .78rem;
  color: #8b8b93;
  margin-top: 12px;
}

@media (max-width: 500px) {
  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; }
}

/* ============ FILTER BAR (moved to catalog.css, kept here for legacy) ============ */
/* ============ LOADING STATE ============ */
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.btn-ghost.is-loading::after,
.btn-light.is-loading::after {
  border-color: rgba(17,17,20,.15);
  border-top-color: var(--text);
}