body.saas-locked {
  overflow: hidden;
}

body.saas-locked #app {
  visibility: hidden;
}

.saas-gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background:
    radial-gradient(circle at 15% 10%, rgba(92, 78, 255, .16), transparent 36%),
    radial-gradient(circle at 90% 85%, rgba(32, 192, 152, .14), transparent 32%),
    #f4f5fb;
  color: #202235;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.saas-gate[hidden] {
  display: none;
}

.saas-auth-card {
  width: min(100%, 470px);
  overflow: hidden;
  border: 1px solid rgba(40, 42, 67, .11);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 26px 80px rgba(36, 38, 68, .15);
}

.saas-auth-brand {
  padding: 28px 30px 22px;
  border-bottom: 1px solid #ececf4;
  background: linear-gradient(135deg, #24243b 0%, #343459 100%);
  color: #fff;
}

.saas-auth-brand span {
  display: block;
  margin-bottom: 5px;
  color: #9cf0d9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.saas-auth-brand h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.03em;
}

.saas-auth-brand p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
  line-height: 1.55;
}

.saas-auth-body {
  padding: 26px 30px 30px;
}

.saas-auth-body h2 {
  margin: 0 0 7px;
  font-size: 21px;
  letter-spacing: -.02em;
}

.saas-auth-body > p {
  margin: 0 0 20px;
  color: #6b6d7d;
  font-size: 13px;
  line-height: 1.55;
}

.saas-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 12px;
  background: #f0f1f6;
}

.saas-tabs button {
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #737587;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.saas-tabs button.active {
  background: #fff;
  color: #25263b;
  box-shadow: 0 2px 9px rgba(36, 38, 68, .09);
}

.saas-form {
  display: grid;
  gap: 14px;
}

.saas-form label {
  display: grid;
  gap: 6px;
  color: #4d4f61;
  font-size: 12px;
  font-weight: 700;
}

.saas-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 13px;
  border: 1px solid #d9dae5;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #25263b;
  font: inherit;
  font-size: 14px;
}

.saas-form input:focus {
  border-color: #6558e8;
  box-shadow: 0 0 0 3px rgba(101, 88, 232, .12);
}

.saas-primary,
.saas-secondary {
  min-height: 43px;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.saas-primary {
  border: 1px solid #5c4fe0;
  background: #6558e8;
  color: #fff;
}

.saas-primary:hover {
  background: #584bd6;
}

.saas-secondary {
  border: 1px solid #d9dae5;
  background: #fff;
  color: #393b50;
}

.saas-primary:disabled,
.saas-secondary:disabled {
  cursor: wait;
  opacity: .62;
}

.saas-link-button {
  display: block;
  margin: 13px auto 0;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #5c4fe0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.saas-link-button:hover {
  text-decoration: underline;
}

.saas-full-width {
  width: 100%;
  margin-top: 16px;
}

.saas-auth-message {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #eef9f5;
  color: #23765e;
  font-size: 12px;
  line-height: 1.5;
}

.saas-auth-message.error {
  background: #fff0f0;
  color: #a73a44;
}

.saas-hint {
  margin-top: 15px;
  color: #77798a;
  font-size: 11px;
  line-height: 1.55;
}

.saas-loader {
  width: 27px;
  height: 27px;
  margin: 5px auto 17px;
  border: 3px solid #e4e4ed;
  border-top-color: #6558e8;
  border-radius: 50%;
  animation: saas-spin .8s linear infinite;
}

@keyframes saas-spin {
  to { transform: rotate(360deg); }
}

.saas-session-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 210px;
}

.saas-session-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saas-account-dialog {
  width: min(470px, calc(100% - 28px));
  max-height: calc(100vh - 34px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #25263b;
  box-shadow: 0 28px 90px rgba(27, 29, 50, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.saas-account-dialog::backdrop {
  background: rgba(28, 30, 52, .45);
  backdrop-filter: blur(3px);
}

.saas-account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 23px;
  border-bottom: 1px solid #ececf4;
  background: linear-gradient(135deg, #24243b 0%, #343459 100%);
  color: #fff;
}

.saas-account-header span {
  color: #9cf0d9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
}

.saas-account-header h2 {
  margin: 5px 0 0;
  font-size: 22px;
}

.saas-account-header button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.saas-account-body {
  padding: 22px 23px 24px;
}

.saas-account-summary {
  display: grid;
  gap: 8px;
  margin: 0 0 21px;
  padding: 13px;
  border: 1px solid #e6e7ef;
  border-radius: 12px;
  background: #f8f9fc;
}

.saas-account-summary div {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  gap: 10px;
}

.saas-account-summary dt {
  color: #77798a;
  font-size: 11px;
  font-weight: 700;
}

.saas-account-summary dd {
  margin: 0;
  overflow: hidden;
  color: #303247;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saas-account-body .saas-form h3 {
  margin: 0;
  font-size: 16px;
}

.saas-password-rule {
  margin: -3px 0 0;
  color: #77798a;
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .saas-gate { padding: 16px; }
  .saas-auth-brand, .saas-auth-body { padding-left: 21px; padding-right: 21px; }
  .saas-session-button span { display: none; }
  .saas-account-body, .saas-account-header { padding-left: 18px; padding-right: 18px; }
}
