/* Auth UI — light professional theme aligned with design references */
:root {
  --auth-blue: #0052d4;
  --auth-blue-hover: #0043b0;
  --auth-bg: #f3f4f6;
  --auth-card: #ffffff;
  --auth-text: #111827;
  --auth-muted: #6b7280;
  --auth-border: #e5e7eb;
  --auth-input-bg: #f9fafb;
  --auth-error: #b91c1c;
  --auth-radius: 12px;
  --auth-radius-sm: 10px;
  --auth-shadow: 0 12px 40px rgba(17, 24, 39, 0.08);
  --auth-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--auth-font);
  color: var(--auth-text);
  background: linear-gradient(180deg, #fafafa 0%, var(--auth-bg) 45%, #eef0f3 100%);
  -webkit-font-smoothing: antialiased;
}

.auth-page a {
  color: var(--auth-blue);
  text-decoration: none;
}
.auth-page a:hover {
  text-decoration: underline;
}

/* Top bar */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--auth-card);
  border-bottom: 1px solid var(--auth-border);
}
.auth-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--auth-text);
}
.auth-topbar__left a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}
.auth-topbar__left a:hover {
  color: var(--auth-blue);
}
.auth-topbar__brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.site-logo,
.site-logo--lg {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}
.site-logo {
  width: 1.25rem;
  height: 1.25rem;
}
.site-logo--lg {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
}
.auth-topbar__right {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-muted);
}
.auth-topbar--relative {
  position: relative;
}

/* Main column */
.auth-main {
  max-width: 440px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.auth-main--narrow {
  max-width: 400px;
}

.auth-hero-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 14px;
  background: var(--auth-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 82, 212, 0.35);
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  line-height: 1.2;
}

.auth-lead {
  margin: 0 auto 1.75rem;
  max-width: 340px;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

.auth-card {
  background: var(--auth-card);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 1.5rem 1.5rem 1.25rem;
}

.auth-field {
  margin-bottom: 1.125rem;
}
.auth-field:last-of-type {
  margin-bottom: 0;
}

.auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--auth-text);
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}
.auth-label-row .auth-label {
  margin-bottom: 0;
}
.auth-forgot {
  font-size: 0.8125rem;
  font-weight: 600;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-wrap .auth-input-icon {
  position: absolute;
  left: 0.875rem;
  pointer-events: none;
  color: var(--auth-muted);
  display: flex;
}
.auth-input-wrap input.auth-input {
  padding-left: 2.75rem;
}
.auth-input-wrap--toggle input.auth-input {
  padding-right: 2.75rem;
}
.auth-toggle-pw {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--auth-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-toggle-pw:hover {
  color: var(--auth-text);
  background: var(--auth-input-bg);
}

input.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-input-bg);
  color: var(--auth-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input.auth-input::placeholder {
  color: #9ca3af;
}
input.auth-input:hover {
  border-color: #d1d5db;
}
input.auth-input:focus {
  outline: none;
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 3px rgba(0, 82, 212, 0.15);
  background: #fff;
}

.auth-hint {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: var(--auth-muted);
}

.auth-legal {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-error {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--auth-error);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--auth-radius-sm);
}

.auth-success {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--auth-radius-sm);
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.875rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--auth-blue);
  border: none;
  border-radius: var(--auth-radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.auth-btn:hover {
  background: var(--auth-blue-hover);
}
.auth-btn:active {
  transform: scale(0.99);
}

.auth-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

.auth-footer-link {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  color: var(--auth-muted);
}

.auth-divider-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #9ca3af;
}
.auth-divider-label::before,
.auth-divider-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.25rem 2rem;
}
.auth-info-card {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  padding: 1rem;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}
.auth-info-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 82, 212, 0.1);
  color: var(--auth-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.auth-info-card__title {
  font-size: 0.8125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}
.auth-info-card__text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--auth-muted);
  line-height: 1.4;
}

.auth-back-login {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.auth-login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-login-header__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: #1e3a5f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-sizing: border-box;
}
.auth-login-header__icon--brand {
  background: transparent;
  overflow: hidden;
  min-width: 0;
  padding: 0;
}
/* Inner clip: caps logo size so wide/tall source images never blow up the page */
.auth-login-header__icon-surface {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  background: #0f1419;
}
.auth-login-header__icon .auth-login-header__logo,
.auth-login-header__icon-surface .auth-login-header__logo,
.auth-login-header__icon-surface img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 64px !important;
  max-height: 64px !important;
  border-radius: 12px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}
/* SVG fallback inside surface (if ever used) */
.auth-login-header__icon-surface svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

/* Welcome / app shell */
.app-shell {
  margin: 0;
  min-height: 100vh;
  font-family: var(--auth-font);
  background: var(--auth-bg);
  color: var(--auth-text);
}
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--auth-card);
  border-bottom: 1px solid var(--auth-border);
}
.app-topbar__brand {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.app-topbar__actions a {
  font-weight: 600;
  font-size: 0.875rem;
}
.app-content {
  max-width: none;
  margin: 0;
  padding: 0;
}
.app-content h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.app-content p {
  color: var(--auth-muted);
  line-height: 1.6;
}
.app-links {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.app-links a {
  color: var(--auth-blue);
  font-weight: 600;
  font-size: 0.9375rem;
}

@media (max-width: 480px) {
  .auth-topbar__brand {
    display: none;
  }
  .auth-info-row {
    grid-template-columns: 1fr;
  }
}
