:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-gradient: linear-gradient(160deg, #eff6ff 0%, #e0e7ff 38%, #f1f5f9 72%, #f8fafc 100%);
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg-gradient);
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

body.embed-mode {
  background: transparent;
  min-height: auto;
  overflow: hidden;
}

html.embed-mode {
  overflow: hidden;
  scrollbar-width: none;
}

html.embed-mode.fit-mode,
body.embed-mode.fit-mode {
  overflow: visible;
}

html.embed-mode::-webkit-scrollbar,
body.embed-mode::-webkit-scrollbar {
  display: none;
}

body.embed-mode .widget-shell {
  padding: 0;
  min-height: auto;
}

body.embed-mode.fit-mode .widget-shell {
  padding: 0;
  min-height: 0;
  height: auto;
  display: block;
  overflow: visible;
}

body.embed-mode.fit-mode .widget-card {
  box-shadow: none;
  border: none;
}

.widget-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
}

.widget-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.widget-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 20px;
}

.widget-logo-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.widget-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.widget-company-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.widget-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.widget-description {
  color: var(--muted);
  margin-bottom: 12px;
  text-align: center;
}

.widget-group-block {
  margin-bottom: 20px;
  text-align: center;
}

.widget-group-block .widget-group {
  margin-bottom: 6px;
}

.widget-group {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.widget-group-detail {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.widget-field {
  margin-bottom: 16px;
}

.widget-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.widget-field input,
.widget-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.widget-field select {
  cursor: pointer;
  appearance: auto;
}

.widget-field input:focus,
.widget-field select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

.widget-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.widget-consent input {
  margin-top: 3px;
  flex-shrink: 0;
}

.widget-submit {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.widget-submit:hover:not(:disabled) {
  background: var(--primary-hover);
}

.widget-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.widget-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.widget-message--success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.widget-message--error {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.widget-disabled,
.widget-loading,
.widget-error {
  color: var(--muted);
  text-align: center;
}

.widget-error {
  color: var(--danger);
}

.widget-brand {
  margin-top: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}
