/* ─── Academiya Keycloak Theme ──────────────────────────────────────────────
   All colors are hardcoded hex — no CSS variables.
   Brand:  #0066A4  |  Brand dark: #005A91  |  Brand bg: #EBF4FB
   ─────────────────────────────────────────────────────────────────────────── */

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

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #111827;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.ac-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Brand Panel (left) ───────────────────────────────────────────────────── */
.ac-brand {
  width: 420px;
  flex-shrink: 0;
  background-color: #0066A4;
  display: flex;
  flex-direction: column;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.ac-brand__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Decorative background circles */
.ac-brand::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  z-index: 1;
}

.ac-brand::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1;
}

/* Logo */
.ac-brand__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}

.ac-brand__logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ac-brand__logo-name {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

/* Headlines */
.ac-brand__headline {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.ac-brand__sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 300px;
}

/* Stats */
.ac-brand__stats {
  display: flex;
  gap: 32px;
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ac-brand__stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.ac-brand__stat-label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

/* Testimonial card */
.ac-brand__quote {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
}

.ac-brand__quote-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 12px;
}

.ac-brand__quote-author {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.ac-brand__quote-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* ── Form Panel (right) ───────────────────────────────────────────────────── */
.ac-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: #ffffff;
  overflow-y: auto;
}

.ac-form-panel__inner {
  width: 100%;
  max-width: 400px;
}

/* Mobile logo — hidden on desktop */
.ac-mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.ac-mobile-logo__name {
  font-size: 20px;
  font-weight: 700;
  color: #0066A4;
  letter-spacing: -0.3px;
}

/* Form header */
.ac-form-header {
  margin-bottom: 28px;
}

.ac-form-header__title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.ac-form-header__sub {
  font-size: 14px;
  color: #6B7280;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.ac-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.ac-alert svg { flex-shrink: 0; margin-top: 1px; }

.ac-alert--error {
  background-color: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

.ac-alert--warning {
  background-color: #FFFBEB;
  border-color: #FDE68A;
  color: #D97706;
}

.ac-alert--success {
  background-color: #F0FDF4;
  border-color: #BBF7D0;
  color: #16A34A;
}

.ac-alert--info {
  background-color: #EBF4FB;
  border-color: #BAD4EA;
  color: #0066A4;
}

/* ── Form Elements ────────────────────────────────────────────────────────── */
.ac-form { width: 100%; }

.ac-field {
  margin-bottom: 18px;
}

.ac-field--error .ac-input {
  border-color: #EF4444;
}

.ac-label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.ac-label .ac-required {
  color: #EF4444;
  margin-left: 2px;
}

.ac-input-wrap {
  position: relative;
}

.ac-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  background: #ffffff;
  border: 1.5px solid #D1D5DB;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

.ac-input:focus {
  border-color: #0066A4;
  box-shadow: 0 0 0 3px #EBF4FB;
}

.ac-input::placeholder { color: #9CA3AF; }

.ac-input--password { padding-right: 46px; }

/* Password toggle */
.ac-pwd-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9CA3AF;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.ac-pwd-toggle:hover { color: #6B7280; }

.ac-field-error {
  font-size: 12.5px;
  color: #EF4444;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Row: remember me + forgot password */
.ac-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: -4px;
}

/* Checkbox */
.ac-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.ac-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid #D1D5DB;
  border-radius: 4px;
  cursor: pointer;
  accent-color: #0066A4;
}

.ac-checkbox-label {
  font-size: 13.5px;
  color: #4B5563;
  cursor: pointer;
  user-select: none;
}

/* Links */
.ac-link {
  font-size: 13.5px;
  font-weight: 500;
  color: #0066A4;
  text-decoration: none;
  transition: color 0.15s;
}

.ac-link:hover {
  color: #005A91;
  text-decoration: underline;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.ac-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  padding: 0 20px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
  -webkit-appearance: none;
}

.ac-btn:active { transform: scale(0.99); }

.ac-btn--primary {
  background-color: #0066A4;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 102, 164, 0.25);
}

.ac-btn--primary:hover {
  background-color: #005A91;
  box-shadow: 0 4px 12px rgba(0, 102, 164, 0.3);
}

.ac-btn--outline {
  background-color: #ffffff;
  color: #374151;
  border: 1.5px solid #D1D5DB;
}

.ac-btn--outline:hover {
  background-color: #F9FAFB;
  border-color: #9CA3AF;
}

.ac-btn--ghost {
  background-color: transparent;
  color: #0066A4;
  border: 1.5px solid #0066A4;
}

.ac-btn--ghost:hover {
  background-color: #EBF4FB;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.ac-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.ac-divider__line {
  flex: 1;
  height: 1px;
  background: #E5E7EB;
}

.ac-divider__text {
  font-size: 12.5px;
  color: #9CA3AF;
  white-space: nowrap;
}

/* ── Social Providers ─────────────────────────────────────────────────────── */
.ac-social { display: flex; flex-direction: column; gap: 10px; }

.ac-social__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  background: #ffffff;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.ac-social__btn:hover {
  background-color: #F9FAFB;
  border-color: #D1D5DB;
}

/* ── Footer text ──────────────────────────────────────────────────────────── */
.ac-form-footer {
  text-align: center;
  font-size: 13.5px;
  color: #6B7280;
  margin-top: 24px;
}

.ac-form-footer a {
  font-weight: 600;
  color: #0066A4;
  text-decoration: none;
}

.ac-form-footer a:hover {
  text-decoration: underline;
  color: #005A91;
}

/* Security badge */
.ac-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: #9CA3AF;
  margin-top: 32px;
}

/* Info box */
.ac-info-box {
  background: #EBF4FB;
  border: 1px solid #BAD4EA;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: #1D4E6B;
  margin-top: 16px;
  line-height: 1.5;
}

/* Name row (register) */
.ac-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* OTP inputs */
.ac-otp-hint {
  font-size: 13.5px;
  color: #6B7280;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Back link */
.ac-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #6B7280;
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.15s;
}

.ac-back-link:hover { color: #374151; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ac-brand { display: none; }

  .ac-mobile-logo { display: flex; }

  .ac-form-panel {
    padding: 32px 24px;
    justify-content: flex-start;
    padding-top: 40px;
  }

  .ac-form-panel__inner { max-width: 100%; }

  .ac-name-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 480px) {
  .ac-form-panel { padding: 28px 20px; }
  .ac-brand__headline { font-size: 26px; }
}

/* ── Keycloak default overrides (hide inherited styles) ───────────────────── */
#kc-header, #kc-header-wrapper { display: none !important; }
.login-pf body { background: #ffffff !important; }
.login-pf-page { padding: 0 !important; margin: 0 !important; }
