:root {
  --bg-top: #123c70;
  --bg-bottom: #07274b;
  --panel-left: #2d537f;
  --panel-right: #294d79;
  --panel-border: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.16);
  --text-main: #f7fbff;
  --text-soft: rgba(244, 248, 255, 0.82);
  --text-muted: rgba(244, 248, 255, 0.7);
  --button-bg: #f4f4f4;
  --button-text: #1f4d80;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top, rgba(43, 94, 151, 0.22), transparent 35%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 32px);
}

.auth-wrapper {
  width: min(1080px, 100%);
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 1fr);
  background: linear-gradient(
    90deg,
    var(--panel-left) 0%,
    var(--panel-left) 50%,
    var(--panel-right) 50%,
    var(--panel-right) 100%
  );
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
}

.auth-info {
  padding: clamp(28px, 4vw, 56px) clamp(22px, 3vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.auth-info img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 36px;
}

.auth-info h1 {
  margin: 0 0 22px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  word-break: break-word;
}

.auth-info p {
  width: min(320px, 100%);
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-soft);
}

.auth-form {
  padding: clamp(22px, 3vw, 32px) clamp(18px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  min-width: 0;
}

.form-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.form-tab {
  flex: 1;
  width: auto;
  height: 38px;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.form-tab.is-active {
  background: var(--button-bg);
  color: var(--button-text);
}

.form-block {
  display: none;
  flex-direction: column;
}

.form-block.is-active {
  display: flex;
}

.form-block-login {
  padding-top: 6px;
}

.form-block h2 {
  margin: 2px 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.input-group {
  margin-bottom: 12px;
}

input {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  min-width: 0;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: auto;
  height: 28px;
  margin: 0;
  padding: 0 10px;
  transform: translateY(-50%);
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.submit-btn {
  width: 92%;
  height: 36px;
  margin: 6px auto 0;
  border: none;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.submit-btn:hover {
  filter: brightness(0.98);
}

.form-note {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.form-note strong {
  color: var(--text-main);
}

.switch-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.switch-text {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}

.text-switch,
.text-action {
  width: auto;
  height: auto;
  margin: 0 0 0 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.text-switch:hover,
.text-action:hover {
  text-decoration: underline;
}

input[readonly] {
  opacity: 0.9;
}

.msg {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, var(--panel-left), var(--panel-right));
  }

  .auth-info,
  .auth-form {
    padding: 30px 24px;
  }

  .auth-info img {
    margin-bottom: 20px;
  }

  .auth-info p {
    width: 100%;
  }

  .submit-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 12px;
  }

  .auth-wrapper {
    border-radius: 18px;
  }

  .auth-info,
  .auth-form {
    padding: 18px 16px;
  }

  .auth-info img {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
  }

  .auth-info h1 {
    margin-bottom: 14px;
    font-size: 22px;
  }

  .auth-info p {
    font-size: 14px;
    line-height: 1.6;
  }

  .form-tabs {
    gap: 6px;
    padding: 4px;
  }

  .form-tab,
  input {
    height: 40px;
  }

  .submit-btn {
    height: 40px;
  }
}

@media (max-width: 400px) {
  .auth-wrapper {
    border-radius: 16px;
  }

  .auth-info,
  .auth-form {
    padding: 16px 14px;
  }

  .auth-info h1 {
    font-size: 20px;
  }

  .form-block h2 {
    font-size: 17px;
  }

  .switch-text,
  .msg,
  .form-note {
    font-size: 12px;
  }

  .form-tab {
    font-size: 13px;
  }
}
