/**
 * Hora Nerd CRM - Public Form Styles
 * Dark cyber-tech design matching Hora Nerd theme.
 */

.hn-crm-form-container {
  background: var(--hn-surface, #0e1424);
  border: 1px solid var(--hn-border, #1e293b);
  border-radius: var(--hn-radius-lg, 16px);
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  transition: border-color 0.3s ease;
  overflow: hidden;
}

[data-theme="light"] .hn-crm-form-container {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

.hn-crm-form-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00f2fe, #38bdf8, #6366f1);
}

.hn-crm-form-header {
  margin-bottom: 24px;
}

.hn-crm-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--hn-cyan, #00f2fe);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hn-crm-badge-dot {
  width: 7px;
  height: 7px;
  background: var(--hn-cyan, #00f2fe);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--hn-cyan, #00f2fe);
  animation: hnPulseDot 2s infinite ease-in-out;
}

@keyframes hnPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.hn-crm-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--hn-text-primary, #f8fafc);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.hn-crm-subtitle {
  font-size: 0.92rem;
  color: var(--hn-text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.5;
}

/* Grid */
.hn-crm-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.hn-crm-field.col-6 {
  grid-column: span 6;
}

.hn-crm-field.col-12 {
  grid-column: span 12;
}

@media (max-width: 768px) {
  .hn-crm-field.col-6 {
    grid-column: span 12;
  }
  .hn-crm-form-container {
    padding: 22px 18px;
  }
}

/* Labels & Inputs */
.hn-crm-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hn-text-primary, #f8fafc);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.hn-crm-field label .req {
  color: var(--hn-cyan, #00f2fe);
}

.hn-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.hn-field-icon {
  position: absolute;
  left: 14px;
  color: var(--hn-text-tertiary, #64748b);
  pointer-events: none;
  transition: color 0.2s;
}

.hn-crm-field input[type="text"],
.hn-crm-field input[type="email"],
.hn-crm-field input[type="tel"],
.hn-crm-field select,
.hn-crm-field textarea {
  width: 100%;
  background: var(--hn-surface-2, #141d33);
  border: 1px solid var(--hn-border, #1e293b);
  border-radius: var(--hn-radius-sm, 8px);
  padding: 11px 14px 11px 42px;
  color: var(--hn-text-primary, #f8fafc);
  font-size: 0.92rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.hn-crm-field select {
  padding-left: 14px;
  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='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.hn-crm-field textarea {
  padding-left: 14px;
  resize: vertical;
  min-height: 90px;
}

[data-theme="light"] .hn-crm-field input[type="text"],
[data-theme="light"] .hn-crm-field input[type="email"],
[data-theme="light"] .hn-crm-field input[type="tel"],
[data-theme="light"] .hn-crm-field select,
[data-theme="light"] .hn-crm-field textarea {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.hn-crm-field input:focus,
.hn-crm-field select:focus,
.hn-crm-field textarea:focus {
  border-color: var(--hn-cyan, #00f2fe);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
  background: var(--hn-surface, #0e1424);
}

.hn-input-wrap:focus-within .hn-field-icon {
  color: var(--hn-cyan, #00f2fe);
}

/* Urgency Selector */
.hn-urgency-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .hn-urgency-selector {
    grid-template-columns: 1fr;
  }
}

.hn-urgency-option {
  position: relative;
  cursor: pointer;
}

.hn-urgency-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hn-urgency-card {
  display: block;
  background: var(--hn-surface-2, #141d33);
  border: 1px solid var(--hn-border, #1e293b);
  border-radius: var(--hn-radius-sm, 8px);
  padding: 12px;
  transition: all 0.2s ease;
  height: 100%;
  box-sizing: border-box;
}

.hn-urgency-card .urgency-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hn-text-primary, #f8fafc);
  margin-bottom: 4px;
}

.hn-urgency-card .urgency-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--hn-text-secondary, #94a3b8);
  line-height: 1.35;
}

.hn-urgency-option input[type="radio"]:checked + .hn-urgency-card {
  border-color: var(--hn-cyan, #00f2fe);
  background: rgba(0, 242, 254, 0.06);
  box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.2);
}

.hn-urgency-option.is-critical input[type="radio"]:checked + .hn-urgency-card {
  border-color: #ff2a5f;
  background: rgba(255, 42, 95, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 42, 95, 0.25);
}

/* Footer & Button */
.hn-crm-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--hn-border, #1e293b);
  padding-top: 20px;
}

.hn-crm-security-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--hn-text-tertiary, #64748b);
}

.hn-crm-submit-btn {
  background: linear-gradient(135deg, #00f2fe 0%, #0284c7 100%);
  color: #070a12;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hn-crm-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 242, 254, 0.45);
}

.hn-crm-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: hnSpin 0.8s linear infinite;
}

.hn-crm-submit-btn.is-loading .btn-spinner {
  display: inline-block;
}

@keyframes hnSpin {
  to { transform: rotate(360deg); }
}

/* Alerts */
.hn-crm-alert {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.hn-crm-alert.is-error {
  background: rgba(255, 42, 95, 0.12);
  border: 1px solid rgba(255, 42, 95, 0.4);
  color: #ff6b8b;
}

/* Success Card */
.hn-crm-success {
  text-align: center;
  padding: 40px 20px;
  animation: hnFadeInUp 0.4s ease;
}

@keyframes hnFadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.hn-crm-success-icon {
  margin-bottom: 16px;
  display: inline-flex;
  padding: 16px;
  border-radius: 50%;
  background: rgba(0, 245, 155, 0.12);
  border: 1px solid rgba(0, 245, 155, 0.35);
}

.hn-crm-success-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--hn-text-primary, #f8fafc);
  margin: 0 0 10px;
}

.hn-crm-success-text {
  font-size: 1rem;
  color: var(--hn-text-secondary, #94a3b8);
  max-width: 520px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.hn-crm-success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hn-crm-wa-action {
  background: #25d366;
  color: #070a12 !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.3);
}

.hn-crm-wa-action:hover {
  background: #20bd5a;
  transform: translateY(-2px);
}

