:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #667085;
  --primary: #1250e6;
  --primary-dark: #0d46d0;
  --green: #0f8d2d;
  --green-dark: #0b7324;
  --border: #dfe7f4;
  --shadow: 0 12px 30px rgba(41, 47, 76, 0.1);
  --shadow-soft: 0 8px 20px rgba(41, 47, 76, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --danger: #dc2626;
  --success-bg: #ecfdf3;
  --success-text: #027a48;
  --error-bg: #fef2f2;
  --error-text: #b42318;
  --info-bg: #eef4ff;
  --info-text: #1d4ed8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(30, 99, 242, 0.12), transparent 28%),
    linear-gradient(180deg, #eaf4ff 0%, #f5f7fb 34%, #f5f7fb 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  padding-bottom: 92px;
}

button,
input {
  font: inherit;
}

form {
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-hero {
  padding: 22px 18px 8px;
  background: transparent;
}

.auth-hero__topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
}

.auth-top-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 220px);
}

.auth-top-brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(26, 86, 232, 0.14);
  background: #fff;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-top-brand__name {
  font-size: 16px;
  font-weight: 800;
  color: #1f2c63;
  white-space: nowrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: 18px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.auth-brand__text {
  display: grid;
  gap: 2px;
}

.auth-brand__text--center {
  justify-items: center;
}

.auth-badge {
  display: none;
  margin: 0;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-brand__text h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.auth-brand__text p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 560px;
}

.auth-brand__text p:last-child:empty {
  display: none;
}

.auth-main {
  flex: 1;
  padding: 0 16px 24px;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 640px;
  display: grid;
  gap: 8px;
}

.auth-mode--hidden {
  display: none;
}

.invite-notice {
  border-radius: 18px;
  padding: 14px 14px;
  border: 1px solid transparent;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.invite-notice[hidden] {
  display: none !important;
}

.invite-notice strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.invite-notice p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.invite-notice--info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: #dbeafe;
}

.invite-notice--error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #fecaca;
}

.auth-action-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.auth-action-card--enter {
  background: linear-gradient(180deg, #14943a 0%, #0c812f 100%);
  color: #ffffff;
}

.auth-action-card--register {
  background: #ffffff;
  border: 2px solid var(--green);
  color: var(--green-dark);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.auth-action-card__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-action-card__icon svg {
  width: 100%;
  height: 100%;
}

.auth-action-card--register strong {
  display: block;
  font-size: 16px;
  margin-bottom: 0;
}

.auth-action-card--register p {
  margin: 0;
  line-height: 1.2;
  font-size: 12px;
}

.auth-action-card__arrow {
  font-size: 34px;
  line-height: 1;
  font-weight: 400;
  align-self: center;
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.form-group--inline {
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
}

.form-group__control {
  min-width: 0;
}

.form-message[hidden],
.btn-secondary[hidden] {
  display: none !important;
}

.form-group label {
  font-weight: 700;
  font-size: 14px;
  padding-top: 14px;
}

.form-group input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.password-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.password-wrapper input {
  min-width: 0;
}

.toggle-password {
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.field-error {
  min-height: 18px;
  color: #ffe4e6;
  font-size: 12px;
  font-weight: 700;
}

.form-options {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.text-link {
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
}

.form-message {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.auth-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  .form-group--inline {
    grid-template-columns: 66px minmax(0, 1fr);
    column-gap: 10px;
  }

  .form-group label {
    padding-top: 12px;
  }

  .auth-action-card--register {
    grid-template-columns: auto 1fr auto;
    gap: 9px;
    padding: 9px 12px;
  }
}

@media (max-width: 460px) {
  .auth-brand__text h1 {
    font-size: 26px;
  }

  .auth-top-brand {
    gap: 8px;
  }

  .auth-top-brand__logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .auth-top-brand__name {
    font-size: 14px;
  }

  .form-group--inline {
    grid-template-columns: 58px minmax(0, 1fr);
    column-gap: 6px;
  }

  .form-group label {
    font-size: 13px;
    padding-top: 11px;
  }

  .password-wrapper {
    gap: 6px;
  }

  .toggle-password {
    padding: 11px 8px;
    font-size: 11px;
  }
}

.form-message--error {
  background: #fff5f5;
  color: var(--error-text);
}

.form-message--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.btn-secondary {
  width: 100%;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  background: #ffffff;
  color: var(--green-dark);
  box-shadow: 0 10px 24px rgba(5, 61, 20, 0.16);
}

.auth-photo {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.auth-photo img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (max-width: 520px) {
  body {
    padding-bottom: 76px;
  }

  .auth-shell {
    min-height: auto;
  }

  .auth-hero {
    padding: 26px 20px 10px;
  }

  .auth-brand__text h1 {
    font-size: 30px;
  }

  .auth-main {
    flex: 0 0 auto;
    padding: 8px 16px 8px;
  }

  .auth-card.auth-card--professional-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .auth-card--professional-flow > #authForm {
    margin: 0 0 8px;
  }

  .auth-action-card--register {
    margin: 0 0 8px;
    padding: 9px 12px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .auth-photo {
    margin-top: 0;
  }

  .auth-action-card__icon {
    width: 34px;
    height: 34px;
  }
}
