:host {
  --brand: #e33dcf;
  --brand-dark: #8b2d7f;
  --text: #111214;
  --muted: rgba(17, 18, 20, 0.66);
  --danger: #dc3545;
  --success: #198754;
  --border: rgba(17, 18, 20, 0.12);
  --card-bg: rgba(255, 255, 255, 0.84);
  --surface: #ffffff;
  display: block;
}

.system-provision-page {
  min-height: 100vh;
  padding: 24px 12px 110px;
  position: relative;
  background:
    radial-gradient(780px 360px at 10% 0%, rgba(227, 61, 207, 0.16), transparent 60%),
    radial-gradient(900px 380px at 90% 16%, rgba(3, 15, 170, 0.12), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #f4f6fb 100%);
}

.page-blob {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(36px);
  opacity: 0.5;
  z-index: 0;
  background: radial-gradient(circle at 40% 40%, rgba(227, 61, 207, 0.4), rgba(227, 61, 207, 0.08));

  &.blob-1 {
    width: 420px;
    height: 420px;
    top: -150px;
    left: -160px;
  }

  &.blob-2 {
    width: 560px;
    height: 560px;
    top: -230px;
    right: -260px;
  }

  &.blob-3 {
    width: 360px;
    height: 360px;
    bottom: -160px;
    left: 30%;
  }
}

.container-shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.card-shell {
  background: var(--card-bg);
  border: 1px solid rgba(227, 61, 207, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 24px 50px rgba(17, 18, 20, 0.12);
  overflow: hidden;
}

.card-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(17, 18, 20, 0.08);

  h1 {
    margin: 10px 0 6px;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text);
  }

  p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
  }
}

.title-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(227, 61, 207, 0.24);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brand-dark);

  i {
    color: var(--brand);
  }
}

.card-body {
  padding: 20px 28px 28px;
}

.alert-box {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;

  ul {
    margin: 8px 0 0 18px;
  }

  &.error {
    color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.22);
  }

  &.success {
    color: var(--success);
    background: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.24);
  }
}

.provision-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 6px;

  &.span-2 {
    grid-column: span 2;
  }

  label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
}

.select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.form-control {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;

  &:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(227, 61, 207, 0.14);
  }
}

.field-help {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.field-error {
  font-size: 0.78rem;
  color: var(--danger);
  font-weight: 700;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(17, 18, 20, 0.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;

  input {
    margin-top: 4px;
  }
}

.role-content {
  display: grid;
  gap: 2px;

  strong {
    font-size: 0.88rem;
    color: var(--text);
  }

  span {
    font-size: 0.78rem;
    color: var(--muted);
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  height: 40px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(120deg, #e33dcf, #b131a0);
  color: #fff;

  &:disabled {
    opacity: 0.65;
    cursor: not-allowed;
  }
}

.btn-ghost {
  border-color: rgba(17, 18, 20, 0.16);
  background: #fff;
  color: var(--text);
}

@media (max-width: 992px) {
  .card-header,
  .card-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .roles-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .system-provision-page {
    padding-top: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field.span-2 {
    grid-column: span 1;
  }

  .select-row {
    grid-template-columns: 1fr;
  }
}
