:root {
  color: #10213f;
  background: #f5f8fc;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  --canvas: #f5f8fc;
  --surface: rgba(255, 255, 255, 0.98);
  --ink: #10213f;
  --muted: #65748b;
  --shell: #0a2b65;
  --blue: #2468e8;
  --blue-dark: #1756c7;
  --coral: #ff5e67;
  --pine: #0f5b54;
  --line: #dbe4f0;
  --success: #0f8f45;
  --danger: #b73543;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
}

.login-topbar {
  display: flex;
  height: 82px;
  align-items: center;
  justify-content: flex-start;
  direction: rtl;
  padding: 13px clamp(22px, 4vw, 58px);
  border-bottom: 3px solid var(--coral);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(19, 48, 89, 0.08);
}

.login-topbar img {
  display: block;
  width: clamp(160px, 15vw, 220px);
  height: 48px;
  margin: 0;
  object-fit: contain;
}

.login-topbar > div {
  display: grid;
  gap: 2px;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 18px;
  color: var(--ink);
  direction: rtl;
  text-align: right;
}

.login-topbar strong {
  font-size: 13px;
}

.login-topbar span {
  color: var(--muted);
  font: 500 10px/1.4 Arial, sans-serif;
  letter-spacing: .08em;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 136px);
  grid-template-columns: minmax(0, 1fr) minmax(520px, 1fr);
  direction: ltr;
  padding: clamp(34px, 4vw, 66px);
  background:
    radial-gradient(circle at 12% 14%, rgba(0, 166, 200, .10), transparent 28%),
    radial-gradient(circle at 86% 78%, rgba(36, 104, 232, .09), transparent 31%),
    var(--canvas) url("/storage/trusted-brand/trusted-topography.png") center / cover;
}

.login-story,
.login-panel {
  direction: rtl;
}

.login-story {
  position: relative;
  display: flex;
  min-height: 680px;
  align-items: center;
  overflow: hidden;
  padding: clamp(46px, 6vw, 94px);
}

.login-story__copy {
  width: min(560px, 100%);
}

.story-rule {
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 28px;
  background: var(--blue);
}

.login-story h2 {
  margin: 0;
  color: var(--shell);
  font-size: clamp(35px, 3.5vw, 54px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.login-story p {
  max-width: 490px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.25vw, 19px);
  line-height: 1.9;
}

.login-panel {
  display: flex;
  width: min(680px, calc(100% - 34px));
  min-height: 680px;
  align-self: center;
  justify-self: center;
  flex-direction: column;
  justify-content: center;
  padding: clamp(46px, 3.2vw, 58px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 22px 62px rgba(19, 48, 89, 0.13);
}

.login-panel__brand {
  text-align: center;
}

.login-panel__brand img {
  display: block;
  width: min(370px, 78%);
  height: 92px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.login-panel__brand h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 2.2vw, 35px);
  font-weight: 760;
  line-height: 1.45;
}

.login-panel__brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font: 500 15px/1.5 Arial, sans-serif;
}

.login-panel__intro {
  margin: 28px 0 24px;
  text-align: center;
}

.login-panel__intro span {
  display: block;
  width: 46px;
  height: 2px;
  margin: 0 auto 22px;
  background: var(--blue);
}

.login-panel__intro p {
  max-width: 500px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

form {
  width: min(520px, 100%);
  margin: 0 auto;
}

.login-methods {
  display: grid;
  width: min(520px, 100%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 auto 22px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9fc;
}

.method-button {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 700 11px/1.35 "Segoe UI", Tahoma, Arial, sans-serif;
}

.method-button:hover,
.method-button:focus-visible {
  color: var(--blue-dark);
  outline: none;
}

.method-button.is-active {
  background: #fff;
  color: var(--shell);
  box-shadow: 0 5px 15px rgba(19, 48, 89, 0.10);
}

form label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

form input {
  width: 100%;
  min-height: 58px;
  padding: 14px 17px;
  border: 1px solid #cbd6e3;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  direction: ltr;
  font: 500 16px/1.4 "Segoe UI", Tahoma, Arial, sans-serif;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 104, 232, 0.16);
  outline: none;
}

.primary {
  width: 100%;
  min-height: 58px;
  margin-top: 16px;
  padding: 14px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font: 750 15px/1.3 "Segoe UI", Tahoma, Arial, sans-serif;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary:hover,
.primary:focus-visible {
  background: var(--blue-dark);
  box-shadow: 0 10px 26px rgba(23, 86, 199, 0.24);
  outline: none;
  transform: translateY(-1px);
}

.primary:focus-visible {
  box-shadow: 0 0 0 4px rgba(36, 104, 232, 0.2), 0 10px 26px rgba(23, 86, 199, 0.2);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.validity-note {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.code-form {
  padding-top: 4px;
}

#alternate-form label + input {
  margin-bottom: 16px;
}

.passkey-panel {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 25px;
  border: 1px solid #cfe0f8;
  border-radius: 14px;
  background: linear-gradient(145deg, #f7fbff, #eef5ff);
  text-align: center;
}

.passkey-panel h2 {
  margin: 7px 0 5px;
  color: var(--shell);
  font-size: 18px;
}

.passkey-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.passkey-symbol {
  color: var(--blue);
  font-size: 35px;
  line-height: 1;
}

.code-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 19px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.code-heading span,
.code-heading strong {
  display: block;
}

.code-heading span {
  color: var(--muted);
  font-size: 11px;
}

.code-heading strong {
  margin-top: 4px;
  color: var(--ink);
  direction: ltr;
  font-size: 13px;
  text-align: right;
}

.code-heading button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--blue-dark);
  cursor: pointer;
  font: 700 11px/1.2 "Segoe UI", Tahoma, Arial, sans-serif;
}

.code-heading button:hover,
.code-heading button:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.code-form input {
  font: 750 28px/1.2 Arial, sans-serif;
  letter-spacing: 10px;
  text-align: center;
}

.message {
  width: min(520px, 100%);
  min-height: 24px;
  margin: 13px auto 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.message.success {
  color: var(--success);
}

.role-note {
  width: min(520px, 100%);
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.login-footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px clamp(22px, 4vw, 58px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 10px;
}

.login-footer span:last-child {
  direction: ltr;
  font-family: Arial, sans-serif;
  letter-spacing: 0.06em;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .login-story {
    min-height: 270px;
    padding-block: 54px;
  }

  .login-story__copy {
    margin-inline: auto;
  }

  .login-story h2 {
    font-size: clamp(34px, 7vw, 48px);
  }

  .login-panel {
    width: min(640px, calc(100% - 32px));
    min-height: auto;
    margin: 0 auto 32px;
    border: 1px solid var(--line);
    box-shadow: var(--trusted-shadow, 0 20px 58px rgba(66, 58, 47, 0.12));
  }
}

@media (max-width: 600px) {
  .login-topbar {
    height: 66px;
    justify-content: center;
  }

  .login-topbar img {
    width: 150px;
    height: 38px;
    margin: 0;
  }

  .login-topbar > div {
    display: none;
  }

  .login-story {
    min-height: 215px;
    padding: 38px 24px;
  }

  .login-story h2 {
    font-size: 32px;
  }

  .login-story p {
    margin-top: 12px;
    font-size: 13px;
  }

  .story-rule {
    margin-bottom: 18px;
  }

  .login-panel {
    min-height: calc(100vh - 281px);
    margin: 0 auto 18px;
    padding: 42px 22px 36px;
    border-radius: 16px;
  }

  .login-panel__brand img {
    width: 260px;
    height: 70px;
  }

  .login-panel__brand h1 {
    font-size: 24px;
  }

  .login-panel__intro {
    margin-block: 22px 20px;
  }

  .code-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-form input {
    letter-spacing: 7px;
  }

  .login-methods {
    grid-template-columns: 1fr 1fr;
  }

  .login-footer {
    justify-content: center;
    text-align: center;
  }

  .login-footer span:last-child {
    display: none;
  }
}
