:root {
  --solemtic-blue: #0084b4;
  --solemtic-blue-dark: #00739d;
  --solemtic-orange: #f27420;
  --solemtic-bg: #f8fafc;
  --solemtic-border: #cbd5e1;
  --text: #1e293b;
  --muted: #64748b;
  --success: #15803d;
  --whatsapp: #25d366;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.container {
  width: 100%;
  max-width: 680px;
  padding: 25px;
  background: #fff;
  border-top: 4px solid var(--solemtic-blue);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08);
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.form-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
}

.form-header img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 50%;
}

.connection-row {
  min-height: 24px;
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.connection-badge.online { color: var(--success); }
.connection-badge.online .connection-dot { background: #22c55e; }
.connection-badge.error { color: #b91c1c; }
.connection-badge.error .connection-dot { background: #ef4444; }
.connection-badge.loading .connection-dot { animation: pulse 1s infinite alternate; }

@keyframes pulse {
  to { opacity: 0.3; }
}

.link-button {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--solemtic-blue-dark);
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
}

.link-button:hover { background: transparent; color: var(--text); }
.link-button.muted { color: var(--muted); }

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset:disabled { opacity: 0.62; }

.row {
  display: flex;
  gap: 15px;
}

.requester-group { flex: 2; }
.type-group { flex: 1; }
.form-group { min-width: 0; margin-bottom: 15px; }

label {
  display: block;
  margin-bottom: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

input, select {
  width: 100%;
  min-height: 40px;
  padding: 10px;
  border: 1px solid var(--solemtic-border);
  border-radius: 6px;
  background: var(--solemtic-bg);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

input:focus, select:focus {
  border-color: var(--solemtic-blue);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 132, 180, 0.12);
}

.ss-main {
  min-height: 40px;
  padding: 4px !important;
  border: 1px solid var(--solemtic-border) !important;
  border-radius: 6px !important;
  background: var(--solemtic-bg) !important;
}

.ss-main:focus-within {
  border-color: var(--solemtic-blue) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(0, 132, 180, 0.12);
}

.ss-value-text { color: var(--text) !important; font-size: 14px; }
.editor-container { background: var(--solemtic-bg); border-radius: 0 0 6px 6px; }

.ql-toolbar {
  padding: 4px !important;
  border-color: var(--solemtic-border) !important;
  border-radius: 6px 6px 0 0;
  background: #f1f5f9;
}

.ql-container {
  height: 110px;
  border-color: var(--solemtic-border) !important;
  border-radius: 0 0 6px 6px;
  font-size: 14px;
}

button {
  width: 100%;
  min-height: 45px;
  margin-top: 5px;
  padding: 12px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--solemtic-blue);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: background-color 0.2s, transform 0.05s;
}

button:hover { background: var(--solemtic-blue-dark); }
button:active { transform: translateY(1px); }
button:disabled { background: #cbd5e1; cursor: not-allowed; }
button.whatsapp-ready { background: var(--whatsapp); }
button.whatsapp-ready:hover { background: #1ebc59; }

#statusMessage {
  display: none;
  margin-bottom: 15px;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

#statusMessage.show { display: block; }
.status-success { color: var(--success); border: 1px solid #bbf7d0; background: #dcfce7; }
.status-error { color: #b91c1c; border: 1px solid #fca5a5; background: #fee2e2; }
.status-warning { color: #c2410c; border: 1px solid #fed7aa; border-left: 4px solid var(--solemtic-orange); background: #fff7ed; }

#container_solucao { transition: opacity 0.2s; }

.access-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}

.access-overlay[hidden] { display: none; }

.access-card {
  width: min(100%, 390px);
  padding: 26px;
  border-top: 4px solid var(--solemtic-blue);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
}

.access-card img {
  width: 58px;
  height: 58px;
  display: block;
  margin: 0 auto 14px;
  border-radius: 50%;
}

.access-card h2 { margin: 0 0 8px; font-size: 19px; text-align: center; }
.access-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.access-error { min-height: 20px; margin-top: 8px; color: #b91c1c; font-size: 12px; }

@media (max-width: 640px) {
  body { align-items: flex-start; padding: 10px; }
  .container { padding: 18px 15px; border-radius: 10px; }
  .row { display: block; }
  .form-header h1 { font-size: 17px; }
  .ql-container { height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
