/* Receipt Form Styles */
.receipt-form-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding-bottom: 2rem;
  margin-bottom: calc(2rem - var(--nav-height));
}

.receipt-form-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.receipt-form-header .back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.15s;
}

.receipt-form-header .back-button:hover {
  background: var(--bg-hover);
}

.receipt-form-header h1 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.receipt-form {
  padding: var(--space-md);
}

/* Form Sections */
.form-section {
  background: var(--white);
  border-radius: 10px;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-color);
}

.form-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 var(--space-md) 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-section-title .btn {
  font-size: 0.6875rem;
  padding: var(--space-xs) var(--space-sm);
}

/* Form Rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.form-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Form Groups */
.form-group {
  margin-bottom: var(--space-sm);
}

.form-group label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* Input Groups */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input-group-text {
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 6px 0 0 6px;
}

.input-group .form-control {
  border-radius: 0 6px 6px 0;
}

/* Total Amount Special Styling */
.total-amount-group {
  background: var(--bg-color);
  padding: var(--space-md);
  border-radius: 8px;
  margin-top: var(--space-sm);
}

.total-amount-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-color);
}

.total-amount-group .form-control-lg {
  font-size: 1.125rem;
  font-weight: 700;
  padding: var(--space-md);
}

/* Receipt Items List */
.receipt-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.receipt-item-row {
  background: var(--bg-color);
  border-radius: 8px;
  padding: var(--space-md);
}

.receipt-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.receipt-item-number {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary-color);
}

.btn-remove-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.btn-remove-item:hover {
  background: #fef2f2;
  color: var(--danger-color);
}

.receipt-item-row .form-group {
  margin-bottom: var(--space-sm);
}

.receipt-item-row .form-group:last-child {
  margin-bottom: 0;
}

.receipt-item-row .form-row-3 .form-group {
  margin-bottom: 0;
}

/* Form Actions */
.form-actions-sticky {
  position: fixed;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--white);
  padding: var(--space-md);
  border-top: 1px solid var(--border-color);
  z-index: 999;
}

.form-actions-sticky .form-actions-buttons {
  display: flex;
  gap: var(--space-sm);
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.form-actions-sticky .btn-cancel {
  flex: 0 0 auto;
  padding: var(--space-sm) var(--space-lg);
}

.form-actions-sticky .btn-submit {
  flex: 1;
}

/* Button Large */
.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9375rem;
}

/* Alert Styles */
.alert-danger {
  padding: var(--space-md);
  border-radius: 8px;
  margin-bottom: var(--space-md);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8125rem;
}

.alert-danger ul {
  margin: 0;
  padding-left: var(--space-lg);
}

.alert-danger li {
  font-size: 0.8125rem;
}

/* Safe Area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .form-actions-sticky {
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }

  .receipt-form-container {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    margin-bottom: calc(2rem - var(--nav-height) - env(safe-area-inset-bottom));
  }
}
