/* The dashboard's login pages: the Purone ERP sign-in's layout (myholdingerp) — a brand panel with a live info
   panel beside the form card — in the dashboard's own look (ghori-admin global.css, from Shopify's Polaris tokens):
   a black panel like the dashboard's sidebar, the light grey page, a white card with 12px corners and a soft edge,
   8px inputs with a blue focus ring, the near-black raised main button, pastel messages. Light by default; dark
   when the dashboard is dark. */

:root,
[data-theme='light'] {
  --panel: #1a1a1a;
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --border: #e3e3e3;
  --border-bright: #cccccc;
  --input-border: #8a8a8a;
  --text: #303030;
  --muted: #616161;
  --faint: #8a8a8a;
  --primary: #303030;
  --primary-2: #1a1a1a;
  --primary-fg: #ffffff;
  --accent: #005bd3;
  --danger: #8e0b21;
  --danger-bg: #fed1d7;
  --success: #014b40;
  --success-bg: #affebf;
  --warn: #4f4700;
  --warn-bg: #ffeb78;
  --info: #003a5a;
  --info-bg: #d5ebff;
  --panel-text: #f3f3f3;
  --panel-soft: #d4d4d4;
  --panel-muted: #a8a8a8;
  --panel-line: #333333;
  --panel-track: #333333;
  --chart: #4b92e5;
  --card-shadow: 0 0 0 1px rgba(26, 26, 26, 0.07), 0 1px 0 0 rgba(26, 26, 26, 0.07);
  --pill-shadow: 0 1px 0 0 rgba(26, 26, 26, 0.07), 0 0 0 1px rgba(26, 26, 26, 0.04);
  --button-shadow: inset 0 -1px 0 1px rgba(0, 0, 0, 0.8), inset 0 0 0 1px #303030,
    inset 0 0.5px 0 1.5px rgba(255, 255, 255, 0.25);
  --button-default-shadow: inset 0 -1px 0 0 #b5b5b5, inset 0 0 0 1px rgba(0, 0, 0, 0.1),
    inset 0 0.5px 0 1.5px #ffffff;
}

[data-theme='dark'] {
  --panel: #0f0f0f;
  --bg: #1a1a1a;
  --surface: #303030;
  --surface-2: #3a3a3a;
  --border: #4a4a4a;
  --border-bright: #616161;
  --input-border: #8a8a8a;
  --text: #e3e3e3;
  --muted: #b5b5b5;
  --faint: #8a8a8a;
  --primary: #ffffff;
  --primary-2: #f3f3f3;
  --primary-fg: #1a1a1a;
  --accent: #4ba0ff;
  --danger: #ffc2c8;
  --danger-bg: rgba(255, 138, 149, 0.2);
  --success: #8ff0c9;
  --success-bg: rgba(47, 213, 156, 0.18);
  --warn: #ffd98a;
  --warn-bg: rgba(255, 196, 83, 0.2);
  --info: #b3d6ff;
  --info-bg: rgba(75, 160, 255, 0.2);
  --chart: #4ba0ff;
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 0 0 rgba(0, 0, 0, 0.4);
  --pill-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --button-shadow: inset 0 -1px 0 0 #b5b5b5, inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  --button-default-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

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

body.gh-body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[dir='rtl'] body.gh-body {
  font-family: 'IBM Plex Sans Arabic', 'Inter', -apple-system, sans-serif;
}

a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.gh-kicker,
.gh-logo-sub,
.gh-clock,
.gh-today-time {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Layout: the black panel on the left, the form on the right. */
.gh-page {
  display: flex;
  min-height: 100vh;
  background: var(--panel);
}

.gh-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 340px;
  flex-shrink: 0;
  padding: 24px;
  color: var(--panel-text);
  background: var(--panel);
  overflow-y: auto;
  position: relative;
}

/* The panel's text sits above the turning Earth. */
.gh-aside > :not(.gh-globe-wrap) {
  position: relative;
  z-index: 1;
}

/* The turning Earth (resources/js/globe.js): the top of a large globe at the foot of the panel, as on Cloudflare's
   sign-in, in the panel's own greys. */
.gh-globe-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  min-height: 260px;
  pointer-events: none;
  z-index: 0;
}

.gh-globe {
  display: block;
  width: 100%;
  height: 100%;
}

.gh-logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
}

.gh-wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.1;
  color: var(--panel-text);
}

.gh-logo-sub {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--panel-muted);
}

.gh-info-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gh-today {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--panel-line);
  padding-top: 12px;
}

.gh-today-day {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.gh-today-date {
  font-size: 12px;
  color: var(--panel-soft);
}

.gh-today-right {
  text-align: end;
}

.gh-today-time {
  font-size: 20px;
  font-weight: 500;
}

.gh-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--panel-muted);
}

.gh-kicker-on {
  color: var(--panel-soft);
}

.gh-weather {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-weather[hidden] {
  display: none;
}

.gh-weather-temp {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.gh-weather-text {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--panel-soft);
}

.gh-weather-range {
  color: var(--panel-muted);
}

.gh-block {
  border-top: 1px solid var(--panel-line);
  padding-top: 10px;
}

.gh-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.gh-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-track);
}

.gh-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--chart);
}

.gh-clock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.6;
}

.gh-clock-row {
  display: flex;
  justify-content: space-between;
}

.gh-clock-row span:first-child {
  color: var(--panel-muted);
}

.gh-quote {
  font-size: 12px;
  font-style: italic;
  line-height: 1.45;
  color: var(--panel-text);
}

.gh-quote-by {
  margin-top: 2px;
  font-size: 11px;
  color: var(--faint);
}

/* The form side: the light page as a rounded panel beside the black one, like the dashboard's frame. */
.gh-main {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  margin: 8px 8px 8px 0;
  border-radius: 12px;
  padding: 32px;
  background: var(--bg);
}

[dir='rtl'] .gh-main {
  margin: 8px 0 8px 8px;
}

.gh-main-inner {
  width: 100%;
  max-width: 400px;
}

.gh-card {
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.gh-header {
  padding: 20px 20px 4px;
}

.gh-kicker-dark {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.gh-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.gh-username {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.gh-required {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.required {
  color: var(--danger);
}

.gh-card-body {
  padding: 16px 20px 20px;
}

/* Fields: the dashboard's form fields. */
.gh-form,
#kc-form-login {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gh-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.gh-input,
.gh-otp-input {
  width: 100%;
  min-height: 32px;
  height: 36px;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gh-input:hover,
.gh-otp-input:hover {
  border-color: var(--input-border);
}

.gh-input:focus,
.gh-otp-input:focus {
  border-color: var(--input-border);
  box-shadow: 0 0 0 2px var(--accent);
}

.gh-input[aria-invalid='true'] {
  border-color: var(--danger);
}

.gh-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.gh-input-group .gh-input {
  padding-inline-end: 40px;
}

.gh-eye {
  position: absolute;
  inset-inline-end: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.gh-eye:hover {
  background: var(--surface-2);
  color: var(--text);
}

.gh-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.gh-icon-eye {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.gh-icon-eye-off {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.2A10.4 10.4 0 0 1 12 4c6.5 0 10 8 10 8a17 17 0 0 1-2.2 3.2M6.6 6.6C3.7 8.5 2 12 2 12s3.5 7 10 7a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M14.1 14.1a3 3 0 0 1-4.2-4.2'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

.gh-icon-phone {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='6' y='2' width='12' height='20' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E");
}

.gh-field-error {
  color: var(--danger);
  font-size: 12px;
}

.gh-help {
  color: var(--muted);
  font-size: 12px;
}

/* Options: remember me, forgot password, back to sign in. */
.gh-settings {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gh-settings .gh-buttons,
#kc-form-buttons {
  width: 100%;
}

.gh-options-links {
  font-size: 13px;
}

.checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input[type='checkbox'] {
  accent-color: var(--primary);
}

/* Buttons: the dashboard's raised buttons; the main one near-black (white in dark mode). */
.gh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--button-default-shadow);
  transition: background 0.1s;
}

.gh-button:hover {
  background: var(--surface-2);
}

.gh-button-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: var(--button-shadow);
}

.gh-button-primary:hover {
  background: var(--primary-2);
}

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

.gh-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.gh-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.gh-button-block {
  width: 100%;
}

/* Messages: the dashboard's pastel colours. */
.gh-alert {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
}

.gh-alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.gh-alert-success {
  background: var(--success-bg);
  color: var(--success);
}

.gh-alert-warning {
  background: var(--warn-bg);
  color: var(--warn);
}

.gh-alert-info {
  background: var(--info-bg);
  color: var(--info);
}

.gh-info {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.gh-another-way {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
}

.gh-otp-list {
  display: grid;
  gap: 8px;
}

.gh-otp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: var(--card-shadow);
}

#kc-content p,
#kc-content ul {
  color: var(--muted);
}

.gh-invite {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
}

/* Under the card: languages (the dashboard's switch) and copyright. */
.gh-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--faint);
  font-size: 12px;
}

.gh-locales {
  display: inline-flex;
  border-radius: 8px;
  padding: 2px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}

.gh-locales a {
  padding: 3px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.gh-locales a.is-current {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--pill-shadow);
}

/* Tablets: a narrower panel. */
@media (max-width: 1100px) {
  .gh-aside {
    width: 300px;
    padding: 20px;
  }
}

/* Phones: the panel becomes a short band above the card (logo, date, time, weather), like the dashboard's
   black top bar; the page runs edge to edge. */
@media (max-width: 900px) {
  .gh-page {
    flex-direction: column;
  }

  .gh-aside {
    width: 100%;
    gap: 10px;
    padding: 14px 16px;
    overflow: visible;
  }

  .gh-logo {
    width: 30px;
    height: 30px;
  }

  .gh-desktop {
    display: none;
  }

  .gh-globe-wrap {
    display: none;
  }

  .gh-today {
    padding-top: 10px;
  }

  .gh-today-day,
  .gh-today-time {
    font-size: 16px;
  }

  .gh-main,
  [dir='rtl'] .gh-main {
    align-items: flex-start;
    margin: 0;
    border-radius: 12px 12px 0 0;
    padding: 16px 12px;
  }

  /* 16px inputs stop phones zooming in on focus. */
  .gh-input,
  .gh-otp-input {
    font-size: 16px;
  }
}
