/* OSigGen - Custom Styles */

/* Font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Form inputs */
.form-input {
  display: block;
  padding: 0.625rem 0.875rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #ffffff;
  color: #000000;
  font-family: 'Inter', system-ui, sans-serif;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: #46005b;
  box-shadow: 0 0 0 3px rgba(70,0,91,0.15);
}

.form-input::placeholder {
  color: #000000;
}

/* Tab switcher */
.tab-btn {
  color: #000000;
  background: transparent;
}

.tab-btn.active {
  color: #46005b;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.tab-btn:hover:not(.active) {
  color: #000000;
}

/* CTA Button Gradient */
.cta-button {
  background: linear-gradient(135deg, #46005b 0%, #35004a 60%, #106d62 100%);
  box-shadow: 0 4px 6px rgba(70,0,91,0.25), 0 2px 8px rgba(78,189,175,0.15);
}

.cta-button:hover {
  background: linear-gradient(135deg, #35004a 0%, #35004a 50%, #106d62 100%);
  box-shadow: 0 6px 12px rgba(70,0,91,0.3), 0 4px 16px rgba(78,189,175,0.25);
  transform: translateY(-1px);
}

.cta-button:active {
  transform: translateY(0);
}

/* Template card */
.template-card {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
}

.template-card:hover {
  border-color: rgba(70,0,91,0.3);
  background: rgba(70,0,91,0.04);
}

.template-card.active {
  border-color: #46005b;
  background: rgba(70,0,91,0.08);
  box-shadow: 0 0 0 3px rgba(70,0,91,0.1);
}

.template-card .template-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: #000000;
  margin-top: 0.375rem;
  text-align: center;
}

.template-card .template-preview {
  height: 48px;
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Form section */
.form-section {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.form-section-header {
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
  user-select: none;
}

.form-section-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.form-section-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #000000;
}

.form-section-header .chevron {
  width: 1.25rem;
  height: 1.25rem;
  color: #000000;
  transition: transform 0.2s ease;
}

.form-section.collapsed .form-section-body {
  display: none;
}

.form-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.form-section-body {
  padding: 0 1.25rem 1.25rem;
}

.form-field {
  margin-bottom: 0.875rem;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #000000;
  margin-bottom: 0.375rem;
}

.form-field label .required {
  color: #ff3b30;
}

/* File upload */
.file-upload {
  border: 2px dashed rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.file-upload:hover,
.file-upload.dragover {
  border-color: rgba(70,0,91,0.4);
  background: rgba(70,0,91,0.04);
}

.file-upload.has-image {
  border-style: solid;
  border-color: rgba(70,0,91,0.3);
  padding: 0.5rem;
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload .upload-placeholder {
  color: #000000;
  font-size: 0.75rem;
}

.file-upload .upload-placeholder svg {
  margin: 0 auto 0.375rem;
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0.5;
}

.file-upload .preview-img {
  max-height: 60px;
  max-width: 100%;
  border-radius: 6px;
  display: none;
}

.file-upload.has-image .preview-img {
  display: inline-block;
}

.file-upload.has-image .upload-placeholder {
  display: none;
}

.file-upload .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.file-upload.has-image .remove-btn {
  display: flex;
}

/* Color picker */
input[type="color"] {
  -webkit-appearance: none;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 5px;
}

/* Toast animation */
#toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Signature preview area */
#signaturePreview {
  font-family: Arial, sans-serif;
}

/* Scrollbar styling */
#formPanel::-webkit-scrollbar {
  width: 4px;
}

#formPanel::-webkit-scrollbar-track {
  background: transparent;
}

#formPanel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

/* Responsive */
@media (min-width: 1024px) {
  #formPanel {
    max-height: calc(100vh - 112px);
  }
}

@media (max-width: 1023px) {
  #signaturePreview {
    overflow-x: auto;
  }
}

/* Setup guide tabs */
.guide-tab {
  color: #000000;
  background: transparent;
  border: none;
  cursor: pointer;
}

.guide-tab.active {
  color: #46005b;
  background: rgba(70,0,91,0.08);
  font-weight: 600;
}

.guide-tab:hover:not(.active) {
  color: #000000;
  background: rgba(0, 0, 0, 0.03);
}

/* Select styling */
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2386868b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
