* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(74, 122, 255, 0.2), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(112, 60, 255, 0.22), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(19, 191, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #040914 0%, #07101d 42%, #050b14 100%);
  color: #e8eefb;
}

button,
input,
a {
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 0;
  border: 1px solid rgba(118, 140, 191, 0.18);
  border-radius: 32px;
  overflow: hidden;
  background: rgba(7, 15, 29, 0.82);
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(26px);
}

.login-story,
.login-form-panel {
  padding: 42px;
}

.login-story {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 36px;
  background:
    linear-gradient(180deg, rgba(10, 20, 39, 0.72), rgba(8, 16, 31, 0.88)),
    linear-gradient(145deg, rgba(66, 92, 255, 0.18), rgba(107, 49, 255, 0.08));
}

.login-story::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.login-form-panel {
  background: linear-gradient(180deg, rgba(7, 14, 27, 0.96), rgba(6, 12, 22, 0.98));
  border-left: 1px solid rgba(118, 140, 191, 0.12);
  display: grid;
  align-content: center;
  gap: 22px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(78, 108, 255, 0.12);
  border: 1px solid rgba(127, 149, 255, 0.24);
}

.brand-mark span {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #5b8cff 0%, #7b4dff 52%, #5ee6ff 100%);
  box-shadow: 0 0 22px rgba(113, 88, 255, 0.45);
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy strong {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.brand-copy small {
  color: #93a4ca;
  font-size: 0.9rem;
}

.story-copy {
  display: grid;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8ea8ff;
}

.story-copy h1,
.form-header h2 {
  margin: 0;
  letter-spacing: -0.05em;
  line-height: 1;
}

.story-copy h1 {
  font-size: clamp(2.6rem, 4vw, 4rem);
}

.story-copy p,
.form-header p,
.story-panel p {
  margin: 0;
  color: #a8b7d8;
  line-height: 1.65;
}

.story-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(12, 23, 42, 0.72);
  border: 1px solid rgba(126, 145, 191, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.story-head {
  display: grid;
  gap: 12px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(73, 102, 255, 0.18);
  border: 1px solid rgba(103, 128, 255, 0.25);
  color: #dbe5ff;
  font-size: 0.82rem;
  font-weight: 700;
}

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

.story-grid article {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(126, 145, 191, 0.16);
}

.story-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.97rem;
}

.story-grid p {
  font-size: 0.9rem;
  color: #99a9cc;
}

.story-action,
.primary-button,
.secondary-button {
  min-height: 52px;
  border-radius: 16px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease, border-color 140ms ease;
}

.story-action {
  width: fit-content;
  padding: 0 18px;
  color: #dbe5ff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(126, 145, 191, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.story-action:hover {
  transform: translateY(-1px);
}

.form-header {
  display: grid;
  gap: 12px;
}

.form-header h2 {
  font-size: 2.05rem;
}

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

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
  color: #d7e3fb;
}

.field input {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(119, 136, 182, 0.24);
  background: rgba(10, 18, 33, 0.94);
  padding: 0 16px;
  color: #f4f8ff;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.field input::placeholder {
  color: #6d7fa7;
}

.field input:focus {
  border-color: rgba(92, 123, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(77, 110, 255, 0.14);
}

.field input[aria-invalid='true'] {
  border-color: rgba(255, 108, 122, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 83, 109, 0.12);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.remember-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #cad6ef;
  cursor: pointer;
}

.remember-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #5d79ff;
}

.inline-link {
  color: #8ea8ff;
  font-weight: 600;
}

.inline-link:hover {
  color: #b8c8ff;
}

.form-message,
.support-copy {
  display: none;
  margin: 0;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  line-height: 1.5;
}

.form-message.is-visible,
.support-copy.is-visible,
.support-copy:not([hidden]) {
  display: block;
}

.form-message.info,
.support-copy.info {
  background: rgba(58, 99, 255, 0.12);
  border-color: rgba(93, 121, 255, 0.22);
  color: #dbe5ff;
}

.form-message.success,
.support-copy.success {
  background: rgba(27, 148, 89, 0.12);
  border-color: rgba(36, 181, 107, 0.22);
  color: #c8f7dc;
}

.form-message.error,
.support-copy.error {
  background: rgba(190, 48, 75, 0.12);
  border-color: rgba(255, 99, 126, 0.24);
  color: #ffd4de;
}

.primary-button {
  width: 100%;
  color: #ffffff;
  background: linear-gradient(135deg, #3873ff 0%, #7241ff 100%);
  box-shadow: 0 20px 38px rgba(69, 95, 255, 0.34);
}

.primary-button:disabled {
  opacity: 0.72;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #6d7fa7;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 141, 185, 0.34), transparent);
}

.oauth-stack {
  display: grid;
  gap: 14px;
}

.secondary-button {
  width: 100%;
  color: #eff4ff;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 136, 179, 0.2);
}

.secondary-button:disabled {
  opacity: 0.58;
}

.google-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #111827;
  font-weight: 800;
}

.google-button-slot {
  display: none;
  justify-content: center;
}

.google-button-slot iframe {
  border-radius: 999px !important;
}

.auth-footer {
  margin: 0;
  color: #9aaacc;
  text-align: center;
}

@media (max-width: 1040px) {
  .login-card {
    grid-template-columns: 1fr;
  }

  .login-form-panel {
    border-left: 0;
    border-top: 1px solid rgba(118, 140, 191, 0.12);
  }

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

@media (max-width: 720px) {
  .login-shell {
    padding: 18px;
  }

  .login-story,
  .login-form-panel {
    padding: 24px;
  }

  .story-copy h1 {
    font-size: 2.3rem;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
}