:root {
  --primary: #0066ff;
  --primary-dark: #0055dd;
  --bg: #f9f9f9;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-light: #4a5568;
  --btn-bg: #28a745;
  --btn-hover: #218838;
  --btn-portal-bg: #6b7280;
  --btn-portal-hover: #4b5563;
  --btn-portal-text: #ffffff;
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 40px 20px;
  box-sizing: border-box;
}

.container {
  width: 100%;
  max-width: 500px;
}

h1 {
  text-align: center;
  margin-bottom: 25px;
  color: var(--primary-dark);
}

.form {
  background: var(--card);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 15px;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--primary);
}

textarea {
  resize: vertical;
}

textarea[readonly] {
  background: #f4f4f4;
  color: var(--text-light);
  cursor: default;
}

/* Widget options fieldset */
fieldset#widget-config {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 18px;
  background: #fafafa;
}

fieldset#widget-config legend {
  font-weight: bold;
  font-size: 0.95em;
  color: var(--primary-dark);
  padding: 0 6px;
}

fieldset#widget-config label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: normal;
  font-size: 0.95em;
  color: var(--text);
  margin-bottom: 12px;
  cursor: pointer;
}

fieldset#widget-config label:last-child {
  margin-bottom: 0;
}

fieldset#widget-config input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
  cursor: pointer;
  border: none;
  border-radius: 3px;
}

button.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--btn-bg);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-top: 10px;
}

button.btn-primary:hover {
  background: var(--btn-hover);
  transform: scale(1.03);
}

/* Manage Subscription */
.btn-portal-wrapper {
  text-align: center;
  margin-top: 24px;
}

a.btn-portal {
  display: inline-block;
  width: auto;
  min-width: 220px;
  max-width: 100%;
  padding: 12px 24px;
  background: var(--btn-portal-bg);
  color: var(--btn-portal-text);
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  line-height: 1.4;
}

a.btn-portal:hover {
  background: var(--btn-portal-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

a.btn-portal:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message {
  margin-top: 15px;
  font-weight: bold;
  text-align: center;
}

/* Mobile */
@media (max-width: 480px) {
  body {
    padding: 20px 12px;
  }

  .form {
    padding: 18px 16px;
  }

  h1 {
    font-size: 1.4em;
    margin-bottom: 18px;
  }

  button.btn-primary {
    font-size: 1em;
    padding: 13px;
  }

  a.btn-portal {
    min-width: 180px;
    padding: 11px 20px;
    font-size: 0.95em;
  }

  fieldset#widget-config {
    padding: 12px 14px;
  }

  fieldset#widget-config label {
    font-size: 0.9em;
  }
}