:root {
  --mgs-auth-ink: #18181b;
  --mgs-auth-muted: #52525b;
  --mgs-auth-line: #d4d4d8;
  --mgs-auth-paper: #fffef9;
  --mgs-auth-card: #ffffff;
  --mgs-auth-green: #065f46;
  --mgs-auth-green-dark: #022c22;
  --mgs-auth-green-soft: #d1fae5;
  --mgs-auth-red-soft: #fef2f2;
  --mgs-auth-red-line: #fecaca;
  --mgs-auth-red: #991b1b;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--mgs-auth-ink);
  background:
    radial-gradient(circle at top left, rgba(6, 95, 70, 0.14), transparent 32rem),
    linear-gradient(135deg, #f8faf7 0%, var(--mgs-auth-paper) 48%, #eef7f0 100%);
}

.mgs-auth-page {
  min-height: 100vh;
}

.mgs-auth-shell {
  display: grid;
  min-height: 100vh;
}

.mgs-auth-brand {
  display: none;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(2, 44, 34, 0.96), rgba(6, 95, 70, 0.86)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px);
  color: #ffffff;
}

.mgs-auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% 18%;
  height: 22rem;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(-8deg);
}

.mgs-auth-brand__inner {
  position: relative;
  z-index: 1;
  align-self: end;
  max-width: 34rem;
  padding: 5rem;
}

.mgs-auth-kicker {
  margin: 0;
  color: var(--mgs-auth-green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mgs-auth-brand .mgs-auth-kicker {
  color: #a7f3d0;
}

.mgs-auth-title {
  margin: 1rem 0 0;
  font-size: clamp(3rem, 5vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.mgs-auth-copy {
  margin: 1.5rem 0 0;
  color: #ecfdf5;
  font-size: 1.2rem;
  line-height: 1.55;
}

.mgs-auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2.5rem 1.25rem;
}

.mgs-auth-card {
  width: 100%;
  max-width: 28rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  background: var(--mgs-auth-card);
  padding: clamp(1.5rem, 4vw, 2rem);
  box-shadow: 0 24px 70px rgba(39, 39, 42, 0.14);
}

.mgs-auth-heading h2 {
  margin: 0.75rem 0 0;
  font-size: clamp(2rem, 8vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.mgs-auth-flashes {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.mgs-auth-flash {
  border: 1px solid var(--mgs-auth-green-soft);
  border-radius: 0.375rem;
  background: #ecfdf5;
  color: var(--mgs-auth-green-dark);
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
}

.mgs-auth-flash.border-red-200 {
  border-color: var(--mgs-auth-red-line);
  background: var(--mgs-auth-red-soft);
  color: var(--mgs-auth-red);
}

.mgs-auth-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.mgs-auth-form .space-y-2 {
  display: grid;
  gap: 0.5rem;
}

.mgs-auth-label {
  display: block;
  color: #3f3f46;
  font-size: 0.9rem;
  font-weight: 750;
}

.mgs-auth-input {
  display: block;
  width: 100%;
  border: 1px solid var(--mgs-auth-line);
  border-radius: 0.375rem;
  background: #ffffff;
  color: var(--mgs-auth-ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
  padding: 0.8rem 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mgs-auth-input:focus {
  border-color: var(--mgs-auth-green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.mgs-auth-remember {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--mgs-auth-muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.mgs-auth-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--mgs-auth-green);
}

.mgs-auth-submit,
.mgs-auth-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 0.375rem;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 0.82rem 1.25rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mgs-auth-submit {
  background: var(--mgs-auth-green);
  color: #ffffff;
}

.mgs-auth-submit:hover {
  background: var(--mgs-auth-green-dark);
  transform: translateY(-1px);
}

.mgs-auth-submit:focus,
.mgs-auth-oauth:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.mgs-auth-actions {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.mgs-auth-link {
  color: var(--mgs-auth-green);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.mgs-auth-link:hover {
  color: var(--mgs-auth-green-dark);
  text-decoration: underline;
}

.mgs-auth-oauth {
  border: 1px solid #27272a;
  background: #18181b;
  color: #ffffff;
}

.mgs-auth-oauth:hover {
  background: #27272a;
  transform: translateY(-1px);
}

.button_to {
  margin: 0;
}

@media (min-width: 1024px) {
  .mgs-auth-shell {
    grid-template-columns: minmax(26rem, 0.95fr) minmax(28rem, 1.05fr);
  }

  .mgs-auth-brand {
    display: flex;
  }
}
