/* ============================================================
   AutoSMTP AI — client-area auth pages (login / register)
   Scoped redesign for the coowhm-style-2 theme.
   All classes are prefixed `as-` to avoid collisions with the
   theme's Bootstrap-era styles. Loaded only by login.tpl and
   clientregister.tpl.
   ============================================================ */

.as-auth {
  --as-primary: #5a5fe8;
  --as-primary-dark: #4a4fd6;
  --as-primary-soft: rgba(90, 95, 232, 0.09);
  --as-ink: #1e2450;
  --as-text: #3c4164;
  --as-muted: #6f7590;
  --as-border: #e3e6f1;
  --as-field: #f4f5fa;
  --as-field-focus: #ffffff;
  --as-ok: #22a06b;
  --as-warn: #e8a13a;
  --as-bad: #e35d6a;
  --as-radius: 10px;
  display: flex;
  min-height: 100vh;
  font-family: 'Poppins', 'Open Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--as-text);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

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

/* ============ Left hero panel ============ */

.as-auth .as-hero {
  position: relative;
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 44px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(90, 95, 232, 0.55), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(140, 82, 255, 0.35), transparent 55%),
    linear-gradient(160deg, #23296b 0%, #3a3f9f 100%);
}

.as-auth .as-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 26px 26px, 120px 120px, 120px 120px;
  pointer-events: none;
}

.as-auth .as-hero > * { position: relative; z-index: 1; }

.as-auth .as-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.as-auth .as-brand {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.as-auth .as-brand img {
  height: 30px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.as-auth .as-hero-support {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}
.as-auth .as-hero-support:hover { color: #fff; }

.as-auth .as-hero-body { max-width: 460px; }

.as-auth .as-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #cdd2ff;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 22px;
}

.as-auth .as-hero-title {
  font-family: 'Raleway', 'Poppins', sans-serif;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px;
}

.as-auth .as-hero-text {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 26px;
}

.as-auth .as-points {
  list-style: none;
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.as-auth .as-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.as-auth .as-tick {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.18);
  color: #7ff0b6;
  font-size: 10px;
}

.as-auth .as-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
}

.as-auth .as-hero-nav { display: flex; gap: 22px; }

.as-auth .as-hero-nav a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}
.as-auth .as-hero-nav a:hover { color: #fff; }

/* ============ Right form panel ============ */

.as-auth .as-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 48px 40px;
  background: #ffffff;
  min-width: 0;
}

.as-auth .as-panel-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--as-muted);
}

.as-auth .as-panel-top a {
  color: var(--as-primary);
  font-weight: 600;
  text-decoration: none;
}
.as-auth .as-panel-top a:hover { text-decoration: underline; }

.as-auth .as-panel-body {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  flex: 1;
  padding-top: 26px;
}

.as-auth .as-panel-body.as-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.as-auth .as-title {
  font-family: 'Raleway', 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--as-ink);
  text-align: center;
  margin: 0 0 30px;
}

.as-auth .as-title small {
  display: block;
  margin-top: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--as-muted);
}

/* Section dividers */

.as-auth .as-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 26px 0 18px;
}

.as-auth .as-section::before,
.as-auth .as-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--as-border);
}

.as-auth .as-section span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--as-ink);
  white-space: nowrap;
}

/* Fields */

.as-auth .as-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.as-auth .as-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.as-auth .as-span-2 { grid-column: span 2; }
.as-auth .as-span-3 { grid-column: span 3; }

.as-auth .as-field { position: relative; }

.as-auth .as-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--as-muted);
  margin: 0 0 6px;
}

.as-auth .as-req { color: var(--as-bad); }

.as-auth .as-control { position: relative; display: flex; }

.as-auth .as-control > .as-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #a2a7c1;
  pointer-events: none;
  font-size: 13px;
  z-index: 2;
}

/* Restyle theme inputs inside our fields (overrides .form-control/.field) */

.as-auth .as-field input,
.as-auth .as-field select {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  height: auto;
  color: var(--as-ink);
  background: var(--as-field);
  border: 1px solid transparent;
  border-radius: var(--as-radius);
  padding: 12px 14px 12px 40px;
  margin: 0;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.as-auth .as-field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f7590' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.as-auth .as-field input::placeholder { color: #a2a7c1; opacity: 1; }

.as-auth .as-field input:focus,
.as-auth .as-field select:focus {
  background: var(--as-field-focus);
  border-color: var(--as-primary);
  box-shadow: 0 0 0 3px var(--as-primary-soft);
}

.as-auth .as-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--as-field) inset;
}

.as-auth .as-field.has-error input,
.as-auth .as-field.has-error select { border-color: var(--as-bad); }

/* WHMCS-injected phone country-code prefix */

.as-auth .as-field .input-group {
  display: flex;
  width: 100%;
}

.as-auth .as-field .input-group .input-group-addon,
.as-auth .as-field .input-group .input-group-btn {
  background: var(--as-field);
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius) 0 0 var(--as-radius);
  padding: 0;
  min-width: 74px;
  display: flex;
  align-items: center;
}

.as-auth .as-field .input-group .input-group-addon select {
  border: 0;
  background: transparent;
  border-radius: var(--as-radius) 0 0 var(--as-radius);
  padding: 12px 30px 12px 14px;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236f7590' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
}

.as-auth .as-field .input-group input {
  border-radius: 0 var(--as-radius) var(--as-radius) 0;
  border-left: 0;
}

/* Buttons */

.as-auth .as-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--as-radius);
  border: 1px solid transparent;
  padding: 12px 26px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.as-auth .as-btn:active { transform: translateY(1px); }
.as-auth .as-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.as-auth .as-btn-primary,
.as-auth input.as-btn-primary[type="submit"],
.as-auth input#login[type="submit"],
.as-auth input.btn-large.btn-primary[type="submit"] {
  color: #fff !important;
  background: var(--as-primary) !important;
  border: 0 !important;
  box-shadow: 0 8px 20px rgba(90, 95, 232, 0.35);
}
.as-auth .as-btn-primary:hover,
.as-auth input.as-btn-primary[type="submit"]:hover,
.as-auth input#login[type="submit"]:hover,
.as-auth input.btn-large.btn-primary[type="submit"]:hover {
  background: var(--as-primary-dark) !important;
  color: #fff !important;
}

.as-auth .as-btn-ghost,
.as-auth a.as-btn-ghost,
.as-auth button.as-btn-ghost {
  color: var(--as-ink) !important;
  background: #fff !important;
  border: 1px solid var(--as-border) !important;
  box-shadow: none;
}
.as-auth .as-btn-ghost:hover {
  border-color: #c9cde3 !important;
  background: #fafbff !important;
}

.as-auth .as-btn-block { width: 100%; display: flex; }

.as-auth .as-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.as-auth .as-actions > * { flex: 1; }

.as-auth .as-form-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--as-muted);
}

.as-auth .as-form-foot a {
  color: var(--as-primary);
  font-weight: 600;
  text-decoration: none;
}
.as-auth .as-form-foot a:hover { text-decoration: underline; }

/* Checkbox rows */

.as-auth .as-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--as-muted);
  cursor: pointer;
  margin: 0;
}

.as-auth .as-check input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  accent-color: var(--as-primary);
  cursor: pointer;
  -webkit-appearance: checkbox;
  appearance: checkbox;
}

.as-auth .as-check a {
  color: var(--as-primary);
  font-weight: 500;
  text-decoration: none;
}
.as-auth .as-check a:hover { text-decoration: underline; }

/* Password strength (WHMCS PasswordStrength.js hooks) */

.as-auth .as-strength { grid-column: span 2; }

.as-auth .as-strength .progress {
  height: 6px;
  border-radius: 99px;
  background: var(--as-border);
  box-shadow: none;
  margin: 0;
  overflow: hidden;
}

.as-auth .as-strength .progress .progress-bar {
  width: 0;
  background-color: var(--as-bad);
  box-shadow: none;
  transition: width 0.25s, background-color 0.25s;
}

.as-auth .as-strength .progress .progress-bar.progress-bar-success { background-color: var(--as-ok); }
.as-auth .as-strength .progress .progress-bar.progress-bar-warning { background-color: var(--as-warn); }
.as-auth .as-strength .progress .progress-bar.progress-bar-danger { background-color: var(--as-bad); }

.as-auth .as-strength-label {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--as-muted);
  text-align: left;
}

/* Mailing-list optin (bootstrap-switch) */

.as-auth .as-optin {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.as-auth .as-optin-text {
  font-size: 12.5px;
  color: var(--as-muted);
  max-width: 340px;
}

.as-auth .as-optin .bootstrap-switch {
  border-color: var(--as-border);
  border-radius: 9px;
}

.as-auth .as-optin .bootstrap-switch .bootstrap-switch-label {
  background: #fff;
}

/* Alerts (WHMCS error/flash markup restyled) */

.as-auth .alert {
  border-radius: var(--as-radius);
  border: 1px solid #f3cdd1;
  background: #fdf0f1;
  color: #b3414d;
  font-size: 12.5px;
  line-height: 1.55;
  padding: 12px 14px;
  margin: 0 0 16px;
  text-align: left;
}

.as-auth .alert ul { margin: 6px 0 0; padding-left: 18px; }
.as-auth .alert.alert-info {
  border-color: #d8dbfa;
  background: var(--as-primary-soft);
  color: #4a4fd6;
}
.as-auth .alert.alert-success {
  border-color: #c4ecd9;
  background: #ecfaf3;
  color: #1c7a50;
}
.as-auth .alert.alert-warning {
  border-color: #f3e3c3;
  background: #fdf6e8;
  color: #9c7423;
}

/* CAPTCHA (WHMCS includes/captcha.tpl markup, scoped)
   The theme's Bootstrap-3 grid classes (.row / .col-md-8) collapse to 1px
   inside our layout, so normalize every wrapper the include emits. */

.as-auth .text-center.row,
.as-auth .col-md-8 {
  float: none !important;
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 0 16px !important;
  overflow: visible !important;
}

.as-auth #default-captcha-domainchecker {
  display: flex !important;
  align-items: flex-end;
  gap: 14px;
  width: 100%;
  text-align: left;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
}

.as-auth #default-captcha-domainchecker > p {
  display: none;
}

.as-auth #default-captcha-domainchecker .col-6 {
  flex: 1 1 auto;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  padding: 0 !important;
  position: static !important;
}

.as-auth #default-captcha-domainchecker .captchaimage {
  flex: 0 0 auto;
}

.as-auth .captchaimage img {
  width: 150px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--as-border);
  display: block;
}

.as-auth #default-captcha-domainchecker #inputCaptcha {
  display: block;
  width: 100%;
  height: 46px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--as-ink);
  background: var(--as-field);
  border: 1px solid transparent;
  border-radius: var(--as-radius);
  padding: 0 14px;
  margin: 0;
  box-shadow: none;
  outline: none;
}

.as-auth #default-captcha-domainchecker #inputCaptcha:focus {
  background: var(--as-field-focus);
  border-color: var(--as-primary);
  box-shadow: 0 0 0 3px var(--as-primary-soft);
}

/* Generate password button */

.as-auth button.generate-password {
  background: #fff;
  color: var(--as-ink);
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  transition: border-color 0.15s, background 0.15s;
}

.as-auth button.generate-password:hover {
  border-color: #c9cde3;
  background: #fafbff;
}

/* ============ Responsive ============ */

@media (max-width: 960px) {
  .as-auth { flex-direction: column; }

  .as-auth .as-hero {
    flex: none;
    padding: 24px 24px 30px;
  }

  .as-auth .as-hero-title { font-size: 25px; }
  .as-auth .as-hero-body { max-width: none; }
  .as-auth .as-points { display: none; }
  .as-auth .as-hero-text { margin-bottom: 0; }
  .as-auth .as-hero-footer { display: none; }
  .as-auth .as-hero-support { display: none; }

  .as-auth .as-panel { padding: 22px 20px 34px; }

  .as-auth .as-grid,
  .as-auth .as-grid-3 { grid-template-columns: 1fr; }
  .as-auth .as-span-2,
  .as-auth .as-span-3 { grid-column: span 1; }
  .as-auth .as-strength { grid-column: span 1; }

  .as-auth .as-actions { flex-direction: column; }
}
