:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #14b8a6;
  --danger: #dc2626;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28rem),
    linear-gradient(135deg, #ffffff 0%, var(--bg) 48%, #eef4ff 100%);
}

main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-shell,
.top-shell {
  width: min(100%, 960px);
  overflow: hidden;
  border: 1px solid rgba(217, 224, 234, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 420px;
}

.intro {
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 56px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(20, 184, 166, 0.09)),
    #fbfdff;
  border-right: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-size: 20px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 0;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro p,
.form-panel > p,
.top-body p {
  color: var(--muted);
  line-height: 1.8;
}

.form-panel {
  padding: 44px;
  background: var(--panel);
}

.form-panel h2 {
  margin-bottom: 8px;
  font-size: 1.5rem;
  letter-spacing: 0;
}

.form-panel > p {
  margin-bottom: 32px;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--primary);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

button:hover,
.button-link:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.message {
  display: none;
  margin-top: 18px;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.message.is-visible {
  display: block;
}

.message.is-error {
  color: var(--danger);
  background: #fef2f2;
}

.message.is-success {
  color: var(--success-text);
  background: var(--success-bg);
}

.top-shell {
  display: grid;
  gap: 0;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.top-body {
  padding: 44px;
}

.welcome {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--success-text);
  background: var(--success-bg);
  font-size: 0.88rem;
  font-weight: 700;
}

.omikuji-panel {
  display: grid;
  gap: 14px;
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
}

.omikuji-panel h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.omikuji-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.omikuji-result {
  min-height: 96px;
  white-space: pre-wrap;
  border-radius: 8px;
  padding: 16px;
  color: #223047;
  background: #f8fafc;
  line-height: 1.8;
}

.secondary-button {
  color: #344054;
  background: #eef2f7;
}

.secondary-button:hover {
  background: #e2e8f0;
}

@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 36px 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .form-panel,
  .top-body {
    padding: 32px 28px;
  }

  .top-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  main {
    padding: 18px 12px;
  }

  button,
  .button-link {
    width: 100%;
  }
}
