/*
 * Login page (themes/default/views/auth/login.php)
 * Stand-alone stylesheet loaded only on the login page, after dist/css/styles.css.
 * Light, touch-friendly layout: brand panel + form card, single column on phones/tablets.
 */
.auth-page {
  --auth-primary: #2563eb;
  --auth-primary-hover: #1d4ed8;
  --auth-primary-soft: #eff4ff;
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-border: #e2e8f0;
  --auth-surface: #ffffff;
  --auth-bg: #f5f7fb;
  --auth-danger: #dc2626;
  --auth-danger-soft: #fef2f2;
  --auth-success: #16a34a;
  --auth-success-soft: #f0fdf4;
  --auth-radius: 12px;
  --auth-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(1200px 600px at 0% 0%, #e8efff 0%, rgba(232, 239, 255, 0) 60%),
    radial-gradient(900px 500px at 100% 100%, #eaf7f3 0%, rgba(234, 247, 243, 0) 60%),
    var(--auth-bg);
  color: var(--auth-text);
  font-family: var(--auth-font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 20px 50px -20px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

/* Brand panel */
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  background: linear-gradient(160deg, #eff4ff 0%, #f3f0ff 55%, #ecfdf5 100%);
  border-right: 1px solid var(--auth-border);
}
.auth-brand-logo {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 28px;
}
/* Uploaded logos often have their own white background: sit them on a white chip. */
.auth-brand-logo img {
  display: block;
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  box-shadow: 0 6px 16px -10px rgba(15, 23, 42, 0.3);
}
.auth-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-primary);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 10px 20px -8px rgba(37, 99, 235, 0.6);
}
.auth-brand-name {
  margin: 0 0 6px;
  font-family: var(--auth-font);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--auth-text);
}
.auth-brand-tagline {
  margin: 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.5;
}
.auth-clock {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.auth-clock-time {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.auth-clock-date {
  margin-top: 6px;
  color: var(--auth-muted);
  font-size: 14px;
}

/* Form panel */
.auth-form-panel {
  padding: 48px 44px 28px;
  display: flex;
  flex-direction: column;
}
.auth-title {
  margin: 0 0 6px;
  font-family: var(--auth-font);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--auth-text);
}
.auth-subtitle {
  margin: 0 0 28px;
  color: var(--auth-muted);
}

.auth-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: var(--auth-radius);
  font-size: 14px;
  line-height: 1.45;
}
.auth-alert .fa {
  margin-top: 2px;
  font-size: 16px;
}
.auth-alert p {
  margin: 0;
}
.auth-alert-error {
  background: var(--auth-danger-soft);
  color: #991b1b;
  border: 1px solid #fecaca;
}
.auth-alert-success {
  background: var(--auth-success-soft);
  color: #166534;
  border: 1px solid #bbf7d0;
}

.auth-field {
  margin-bottom: 18px;
}
.auth-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-text);
}

.auth-input {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input > .fa {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
}
.auth-input input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  background: #fff;
  color: var(--auth-text);
  font-family: var(--auth-font);
  font-size: 16px; /* 16px stops iOS from zooming in on focus */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: none;
  outline: none;
}
.auth-input input::placeholder {
  color: #94a3b8;
}
.auth-input input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.auth-input input:focus + .auth-toggle-password,
.auth-input:focus-within > .fa {
  color: var(--auth-primary);
}
.auth-input.is-invalid input {
  border-color: var(--auth-danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}
#password {
  padding-right: 48px;
}

.auth-toggle-password,
.auth-icon-button {
  border: 0;
  background: transparent;
  color: #94a3b8;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}
.auth-toggle-password {
  position: absolute;
  right: 2px;
}
.auth-toggle-password:hover,
.auth-icon-button:hover {
  color: var(--auth-text);
  background: #f1f5f9;
}
.auth-toggle-password:focus-visible,
.auth-icon-button:focus-visible,
.auth-link:focus-visible,
.auth-submit:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.auth-hint {
  margin: 6px 0 0;
  font-size: 13px;
}
.auth-caps-warning {
  color: #b45309;
}

.auth-captcha {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.auth-captcha-image img {
  display: block;
  border-radius: 8px;
  border: 1px solid var(--auth-border);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 24px;
}
.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: var(--auth-text);
  cursor: pointer;
  min-height: 32px;
}
.auth-remember input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--auth-primary);
  cursor: pointer;
}
.auth-link {
  color: var(--auth-primary);
  font-weight: 600;
  border-radius: 6px;
}
.auth-link:hover,
.auth-link:focus {
  color: var(--auth-primary-hover);
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--auth-radius);
  background: var(--auth-primary);
  color: #fff;
  font-family: var(--auth-font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.7);
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.auth-submit:hover {
  background: var(--auth-primary-hover);
}
.auth-submit:active {
  transform: translateY(1px);
}
.auth-submit .fa-arrow-right {
  margin-left: 6px;
}
.auth-submit-loading {
  display: none;
}
.auth-submit.is-loading {
  opacity: 0.85;
  cursor: progress;
}
.auth-submit.is-loading .auth-submit-label {
  display: none;
}
.auth-submit.is-loading .auth-submit-loading {
  display: inline;
}

.auth-footer {
  margin-top: auto;
  padding-top: 28px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}
.auth-footer .posbeck-credit {
  color: #64748b;
  font-weight: 600;
}
.auth-footer .posbeck-credit:hover,
.auth-footer .posbeck-credit:focus {
  color: #2563eb;
}

/* Forgot password modal */
.auth-modal .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.35);
  font-family: var(--auth-font);
}
.auth-modal .modal-header,
.auth-modal .modal-footer {
  border-color: var(--auth-border);
}
.auth-modal .modal-title {
  font-weight: 700;
}
.auth-modal .btn {
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 16px;
}
.auth-modal .btn-primary {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
}

/* Tablets in portrait and phones: one column, compact brand header */
@media (max-width: 767px) {
  .auth-shell {
    align-items: flex-start;
    padding: 16px;
  }
  .auth-card {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }
  .auth-brand {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    padding: 20px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--auth-border);
  }
  .auth-brand-logo {
    margin-bottom: 0;
  }
  .auth-brand-logo img {
    max-width: 150px;
    max-height: 52px;
    padding: 6px 10px;
  }
  .auth-brand-mark {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }
  .auth-brand-name {
    font-size: 20px;
    margin: 0;
  }
  .auth-brand-tagline,
  .auth-clock {
    display: none;
  }
  .auth-form-panel {
    padding: 28px 22px 20px;
  }
  .auth-modal .modal-dialog {
    margin: 16px;
  }
}

/* Right-to-left languages */
[dir="rtl"] .auth-brand {
  border-right: 0;
  border-left: 1px solid var(--auth-border);
}
[dir="rtl"] .auth-input > .fa {
  left: auto;
  right: 14px;
}
[dir="rtl"] .auth-input input {
  padding: 0 42px 0 14px;
}
[dir="rtl"] #password {
  padding-left: 48px;
}
[dir="rtl"] .auth-toggle-password {
  right: auto;
  left: 2px;
}
[dir="rtl"] .auth-submit .fa-arrow-right {
  margin-left: 0;
  margin-right: 6px;
  transform: scaleX(-1);
}
@media (max-width: 767px) {
  [dir="rtl"] .auth-brand {
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-input input,
  .auth-submit {
    transition: none;
  }
}
