/* Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/ */
/* custom-form.css — Default styles for the Zammad Custom Form widget */

.zcf-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
  max-width: 640px;
  box-sizing: border-box;
}

.zcf-wrapper *,
.zcf-wrapper *::before,
.zcf-wrapper *::after {
  box-sizing: border-box;
}

.zcf-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Field wrapper */
.zcf-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Labels */
.zcf-label {
  font-size: 13px;
  font-weight: 500;
  color: #444;
}

.zcf-label--required::after {
  content: ' *';
  color: #e53e3e;
}

/* Inputs */
.zcf-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.zcf-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.zcf-input::placeholder {
  color: #9ca3af;
}

textarea.zcf-input {
  resize: vertical;
  min-height: 100px;
}

select.zcf-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Checkbox field */
.zcf-field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.zcf-field--checkbox .zcf-label {
  order: 2;
  margin: 0;
  cursor: pointer;
}

.zcf-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3b82f6;
}

/* Actions */
.zcf-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

/* Buttons */
.zcf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
  text-decoration: none;
  line-height: 1;
}

.zcf-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.zcf-btn--primary {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.zcf-btn--primary:hover:not(:disabled) {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* CAPTCHA */
.zcf-captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.zcf-captcha-img {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  display: block;
  background: #f2f2f2;
}

.zcf-captcha-refresh {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 10px;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}

.zcf-captcha-refresh:hover {
  color: #3b82f6;
  border-color: #3b82f6;
}

.zcf-captcha-input {
  max-width: 160px;
  letter-spacing: 2px;
  font-size: 15px;
  text-transform: uppercase;
}

/* Errors */
.zcf-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 2px;
}

/* Success message */
.zcf-success {
  padding: 20px 24px;
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  color: #15803d;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

/* Disabled / unavailable */
.zcf-disabled {
  padding: 20px 24px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
}

/* Modal overlay */
.zcf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.zcf-modal {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.zcf-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.zcf-modal-close:hover {
  color: #1a1a1a;
}

.zcf-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 20px 0;
  padding-right: 32px;
}

/* Loading state */
.zcf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: #6b7280;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
  .zcf-modal {
    padding: 20px;
    border-radius: 8px;
  }

  .zcf-btn {
    width: 100%;
  }

  .zcf-actions {
    justify-content: stretch;
  }
}
