@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand-500: #2563eb;
  --brand-600: #1d4ed8;
  --bg-page: #f0f4f8;
  --bg-surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --input-border: #d1d5db;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-md: 0 4px 24px rgba(15, 23, 42, 0.08);
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body, #loginBody {
  -webkit-font-smoothing: antialiased;
  font-family: var(--font-sans);
  font-size: 1rem;
  min-height: 100%;
  height: auto;
  line-height: 1.5;
  margin: 0;
  text-align: left;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #f0f4f8 100%);
  overflow-x: hidden;
}

#brickwall,
#background,
#blur {
  display: none;
}

/* ── Page shell ─────────────────────────────────────────────── */
#loginPage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px 72px;
}

.login-decor-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.login-decor {
  position: absolute;
}

.login-decor--tl {
  top: 40px;
  left: -60px;
  width: 200px;
  height: 200px;
}

.login-decor--br {
  bottom: 80px;
  right: -80px;
  width: 240px;
  height: 240px;
  opacity: 0.85;
}

#loginPage > *:not(.login-decor-layer) {
  position: relative;
  z-index: 1;
}

.login-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 40px 48px;
  align-items: center;
  width: 100%;
}

/* ── Left illustration panel ──────────────────────────────── */
.login-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 12px 8px;
}

.login-hero-svg {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
}

.login-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.login-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  backdrop-filter: blur(4px);
}

.login-highlights li i {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--brand-500);
  font-size: 1rem;
}

/* ── Login card ───────────────────────────────────────────── */
#loginBox {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 28px;
  text-align: center;
  position: static;
  left: auto;
  top: auto;
  transform: none;
  margin: 0;
  justify-self: end;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

#loginBox:after {
  display: none;
}

h1 {
  margin: 0 0 8px;
}

#logo a {
  display: block;
  text-decoration: none;
  height: auto;
  padding: 0;
}

#logo a img {
  max-height: 52px;
  max-width: 220px;
  height: auto;
  width: auto;
  vertical-align: middle;
  outline: none;
  border: none;
}

.valign-helper { display: none; }

h3, #login-message {
  margin: 0 0 20px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

form {
  width: 100%;
  margin: 0 auto;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.login-fieldset {
  display: flex;
  flex-direction: column;
  gap: 0;
}

fieldset input {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid var(--input-border);
  background: var(--bg-surface);
  padding: 11px 14px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

fieldset input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

:-webkit-input-placeholder { color: var(--text-muted); font-style: normal; }
:-moz-placeholder { color: var(--text-muted); font-style: normal; }

.login-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 4px;
}

hr {
  margin: 20px 0;
  border: none;
  height: 0;
  border-bottom: 1px solid var(--border-color);
}

div.banner {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

div.banner:empty {
  display: none;
  margin: 0;
  padding: 0;
}

div.banner:not(:empty) {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

input[type="submit"],
input[type="reset"],
input[type="button"],
.action-button,
.button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--brand-500);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand-500);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}

.button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

button[type="submit"],
input[type="submit"],
.primary.button,
.login-actions .submit.button {
  width: 100%;
  margin-top: 0;
}

#reset-link {
  display: inline-block;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--brand-500);
  text-decoration: none;
}

#reset-link:hover {
  color: var(--brand-600);
  text-decoration: underline;
}

#reset-link.hidden {
  display: none;
}

#poweredBy {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 8px 14px;
  text-align: center;
  position: fixed;
  bottom: 16px;
  right: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  text-shadow: none;
  z-index: 2;
}

#poweredBy a { color: var(--text-muted); }

#poweredBy .osticket-logo {
  height: auto;
  width: 48px;
  vertical-align: baseline;
  border: none;
  filter: none;
}

#company {
  position: static;
  left: auto;
  width: auto;
  margin: 20px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

#company .content {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  display: inline;
  padding: 0;
  color: var(--text-muted);
}

.external-auth {
  display: inline-block;
  margin-bottom: 8px;
}

.external-auth + .external-auth {
  margin-top: 8px;
}

a.external-sign-in { text-decoration: none; }

.external-auth-box {
  vertical-align: middle;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.external-auth-icon {
  display: inline-block;
  color: var(--text-secondary);
  width: 30px;
  padding: 8px 10px;
  border-right: 1px solid var(--border-color);
  background: var(--bg-page);
}

.external-auth-name {
  color: var(--text-primary);
  width: 120px;
  padding: 8px 12px;
  line-height: 1.5;
  font-size: 0.85rem;
}

img.sign-in-image {
  border: none;
  max-height: 40px;
  max-width: 200px;
  width: auto;
  height: auto;
}

.hidden { display: none; }

.or { margin: 16px 0; }

#loading.dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  #loginPage {
    padding: 16px 16px 64px;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
  }

  #loginBox {
    order: 1;
    justify-self: center;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
  }

  .login-aside {
    order: 2;
    padding: 0;
    align-items: center;
  }

  .login-hero-svg {
    display: none;
  }

  .login-highlights {
    max-width: 100%;
    width: 100%;
  }

  .login-decor--tl,
  .login-decor--br {
    opacity: 0.5;
  }
}

@media (max-width: 480px) {
  #loginPage {
    padding: 12px 12px 56px;
  }

  #loginBox {
    padding: 28px 20px 24px;
    border-radius: 14px;
  }

  h3, #login-message {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .login-highlights li {
    font-size: 0.82rem;
    padding: 10px 12px;
  }

  #poweredBy {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}
