:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --border: #e5e7eb;
  --border-strong: #dfe3ea;
  --text: #151a33;
  --muted: #777d8d;
  --purple: #6f35f5;
  --purple-dark: #5926dc;
  --button-bg: #f8f9fc;
  --error: #b42318;
  --success: #027a48;
  --shadow: 0 16px 55px rgba(32, 40, 70, 0.05);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 60px 1fr 44px;
  background:
    linear-gradient(90deg, transparent 55px, var(--border) 56px, transparent 57px),
    linear-gradient(90deg, transparent calc(100% - 61px), var(--border) calc(100% - 60px), transparent calc(100% - 59px)),
    #fff;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  border-color: var(--border);
}

.site-header {
  justify-content: space-between;
  padding: 0 68px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 21px;
  height: 18px;
  background: linear-gradient(145deg, #7438fa, #5e2bed);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-button,
.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-button {
  min-width: 82px;
  background: #fcfcfe;
  color: #151a33;
}

.nav-button.primary {
  min-width: 94px;
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
  box-shadow: 0 6px 18px rgba(111, 53, 245, 0.2);
}

.external-arrow {
  margin-left: 8px;
  font-size: 15px;
  line-height: 1;
}

.auth-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 328px;
  min-height: 440px;
  padding: 34px 34px 31px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 17px;
  text-align: center;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-form {
  display: grid;
  gap: 11px;
}

.field-group {
  display: grid;
  gap: 6px;
  color: #2f3658;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: #fcfcfe;
  font: inherit;
  outline: none;
}

.field:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(111, 53, 245, 0.1);
}

.field::placeholder {
  color: #9ba1b3;
}

.primary-submit {
  height: 40px;
  border: 1px solid var(--purple);
  border-radius: 4px;
  color: #fff;
  background: var(--purple);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(111, 53, 245, 0.16);
}

.auth-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.auth-status[data-type="error"] {
  color: var(--error);
}

.auth-status[data-type="success"] {
  color: var(--success);
}

.divider {
  display: flex;
  align-items: center;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 10px;
}

.auth-button {
  width: 100%;
  min-height: 34px;
  margin-bottom: 12px;
  background: var(--button-bg);
  color: #1d2440;
  box-shadow: 0 1px 2px rgba(20, 28, 48, 0.02);
}

.auth-button:last-of-type {
  margin-bottom: 0;
}

.google-icon {
  margin-right: 9px;
  font-size: 16px;
  font-weight: 800;
}

.switch-copy {
  margin: 16px 0 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.switch-copy a {
  color: var(--purple-dark);
  font-weight: 500;
}

.site-footer {
  justify-content: space-between;
  padding: 0 68px;
  border-top: 1px solid var(--border);
  color: #737888;
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 39px;
}

.redirect-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.dashboard-card {
  width: min(520px, 100%);
  padding: 42px;
  text-align: center;
}

.dashboard-title {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.dashboard-copy {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-email {
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 720px) {
  .page-shell {
    grid-template-rows: 66px 1fr auto;
    background: #fff;
  }

  .site-header {
    padding: 0 18px;
  }

  .header-actions {
    gap: 8px;
  }

  .nav-button {
    min-width: auto;
    padding: 0 14px;
  }

  .nav-button.primary {
    min-width: auto;
  }

  .auth-area {
    padding: 34px 18px;
  }

  .auth-card {
    width: 100%;
    max-width: 410px;
    min-height: auto;
    padding: 38px 28px 32px;
  }

  .site-footer {
    min-height: 74px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
  }

  .footer-links {
    gap: 20px;
  }
}
