:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #1d1f2a;
  --foreground-secondary: #6b7280;
  --foreground-tertiary: #98a2b3;
  --accent: #7c5cfc;
  --accent-hover: #6941c6;
  --accent-light: rgba(124, 92, 252, 0.1);
  --border: #e9eaeb;
  --surface-subtle: #f9fafb;
  --shadow-button-skeuo: inset 0 0 0 1px rgba(10, 13, 18, 0.18), inset 0 -2px 0 rgba(10, 13, 18, 0.05), 0 1px 2px rgba(10, 13, 18, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--background);
  color: var(--foreground);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #ffffff;
}

.visual-panel {
  display: none;
}

.visual-frame {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 18px 18px 12px 12px;
}

.visual-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 100vh;
  padding: 40px 24px;
  overflow: hidden;
}

.grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.7;
  background-image: url("/assets/patterns/grid.svg");
  background-repeat: no-repeat;
  background-size: max(100%, 768px) auto;
  background-position: center top;
  mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 65%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 65%);
}

.form-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.brand-head {
  padding-top: 24px;
  text-align: center;
}

.brand-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 12px;
  display: block;
}

.tenant-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  margin: 18px 0 0;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: #ffffff;
  color: var(--foreground-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-head h1 {
  margin: 12px 0 0;
  color: var(--foreground);
  font-size: 38px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-head p:last-child {
  margin: 8px 0 0;
  color: var(--foreground-secondary);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

form {
  display: grid;
  gap: 0;
  margin-top: 32px;
}

label {
  display: block;
  margin: 0 0 8px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

input {
  width: 100%;
  height: 48px;
  margin: 0 0 20px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--foreground);
  font: inherit;
  font-size: 15px;
  outline: none;
  padding: 0 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder {
  color: #9ca3af;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-button-skeuo);
  transition: background 0.18s ease, transform 0.18s ease;
}

button:hover {
  background: var(--accent-hover);
}

button:active {
  transform: translateY(1px);
}

.error {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 -8px;
  padding: 14px;
  border: 1px solid #fee4e2;
  border-radius: 12px;
  background: #fef3f2;
}

.error span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #f04438;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.error p {
  margin: 0;
  color: #d92d20;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
}

.footer-note {
  margin-top: 40px;
  text-align: center;
  color: var(--foreground-tertiary);
  font-size: 12px;
  letter-spacing: 0;
}

@media (min-width: 1024px) {
  .login-shell {
    flex-direction: row;
  }

  .visual-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    min-height: 100vh;
    padding: 24px;
  }

  .form-panel {
    width: 50%;
    padding: 56px 48px;
  }
}

@media (max-width: 520px) {
  .form-panel {
    padding: 32px 20px;
  }

  .brand-head h1 {
    font-size: 32px;
  }
}
