/* ==========================================================
   RedactSure – Keycloak Login Theme
   Split-panel layout · Light theme with crimson accent
   ========================================================== */

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

/* ── Reset & Base ──────────────────────────────────────── */

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

html, body {
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #000000;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #b30000;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #8a0000;
}

/* ── Split Layout ──────────────────────────────────────── */

.rs-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.rs-split--single {
  grid-template-columns: 1fr;
}

/* ── Left Panel (Marketing) ────────────────────────────── */

.rs-panel {
  background: #111111;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

/* Flowing wave shapes */
.rs-panel__waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Radial glows */
.rs-panel__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.rs-panel__glow--top {
  top: -15%;
  right: -10%;
  width: 55%;
  height: 45%;
  background: radial-gradient(circle, rgba(179, 0, 0, 0.12) 0%, transparent 70%);
}

.rs-panel__glow--bottom {
  bottom: -10%;
  left: -15%;
  width: 60%;
  height: 50%;
  background: radial-gradient(circle, rgba(179, 0, 0, 0.08) 0%, transparent 70%);
}

/* Content layer */
.rs-panel__inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.rs-panel__hero {
  margin-top: auto;
  margin-bottom: auto;
  padding-bottom: 10%;
}

.rs-panel__headline {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #ffffff;
}

.rs-panel__brand-text {
  color: #e84040;
}

.rs-panel__tagline {
  font-size: 15px;
  color: #808080;
  line-height: 1.7;
}

.rs-panel__footer {
  margin-top: 40px;
  font-size: 12px;
  color: #555555;
}

/* ── Right Panel (Form) ────────────────────────────────── */

.rs-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: #ffffff;
}

.rs-form-panel__inner {
  width: 100%;
  max-width: 380px;
}

.rs-form-panel__logo {
  margin-bottom: 36px;
}

.rs-form-panel__logo img {
  height: 28px;
  width: auto;
}

.rs-split--single .rs-form-panel__logo {
  text-align: center;
}

/* ── Card header ───────────────────────────────────────── */

.rs-card__title {
  font-size: 24px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 6px;
}

.rs-card__subtitle {
  font-size: 15px;
  color: #808080;
  margin-bottom: 28px;
}

/* ── Alerts ────────────────────────────────────────────── */

.rs-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.rs-alert::before {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.rs-alert--error {
  background: rgba(179, 0, 0, 0.04);
  border: 1px solid rgba(179, 0, 0, 0.15);
  color: #b30000;
}

.rs-alert--error::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b30000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
}

.rs-alert--success {
  background: rgba(21, 87, 36, 0.04);
  border: 1px solid rgba(21, 87, 36, 0.15);
  color: #155724;
}

.rs-alert--success::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23155724' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

.rs-alert--info {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid #e0e0e0;
  color: #555555;
}

.rs-alert--info::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
}

.rs-alert--warning {
  background: rgba(179, 0, 0, 0.02);
  border: 1px solid rgba(179, 0, 0, 0.1);
  color: #808080;
}

.rs-alert--warning::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b30000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}

/* ── Form Elements ─────────────────────────────────────── */

.rs-form-group {
  margin-bottom: 20px;
}

.rs-form-group label,
.rs-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
}

.rs-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  color: #000000;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.rs-input:focus {
  border-color: #b30000;
  box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.08);
}

.rs-input::placeholder {
  color: #b0b0b0;
}

.rs-input--error {
  border-color: #b30000;
}

/* ── Label row (label + forgot link) ───────────────────── */

.rs-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rs-label-row label {
  margin-bottom: 0;
}

.rs-label-row a {
  font-size: 13px;
  font-weight: 500;
  color: #b30000;
}

/* ── Checkbox ──────────────────────────────────────────── */

.rs-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.rs-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #b30000;
  cursor: pointer;
  flex-shrink: 0;
}

.rs-checkbox label {
  font-size: 14px;
  font-weight: 400;
  color: #808080;
  cursor: pointer;
  margin: 0;
}

/* ── Buttons ───────────────────────────────────────────── */

.rs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.rs-btn--primary {
  width: 100%;
  color: #ffffff;
  background: #b30000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rs-btn--primary:hover {
  background: #990000;
  box-shadow: 0 2px 8px rgba(179, 0, 0, 0.25);
  color: #ffffff;
}

.rs-btn--ghost {
  background: transparent;
  border: 2px solid #e0e0e0;
  color: #000000;
}

.rs-btn--ghost:hover {
  border-color: #b30000;
  color: #b30000;
}

.rs-btn--link {
  background: none;
  border: none;
  color: #b30000;
  padding: 0;
  height: auto;
  font-weight: 500;
}

.rs-btn--link:hover {
  color: #8a0000;
}

/* ── Form actions ──────────────────────────────────────── */

.rs-form-actions {
  margin-top: 28px;
}

/* ── Separator ─────────────────────────────────────────── */

.rs-separator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  color: #b0b0b0;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rs-separator::before,
.rs-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

/* ── Social / Identity Providers ───────────────────────── */

.rs-social-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rs-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  color: #000000;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.rs-social-btn:hover {
  border-color: #b30000;
  color: #b30000;
}

/* ── Footer link ───────────────────────────────────────── */

.rs-form-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 15px;
  color: #808080;
}

.rs-form-footer a {
  color: #b30000;
  font-weight: 600;
}

/* ── OTP / TOTP ────────────────────────────────────────── */

.rs-otp-info {
  font-size: 14px;
  color: #808080;
  margin-bottom: 24px;
  line-height: 1.7;
}

.rs-otp-info ol {
  padding-left: 20px;
  margin-top: 12px;
}

.rs-otp-info li {
  margin-bottom: 8px;
}

.rs-qr-code {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  padding: 20px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.rs-qr-code img {
  display: block;
}

.rs-totp-secret {
  text-align: center;
  margin-bottom: 24px;
}

.rs-totp-secret code {
  display: inline-block;
  padding: 10px 18px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: "Inter", monospace;
  font-size: 14px;
  color: #000000;
  letter-spacing: 0.08em;
  word-break: break-all;
}

/* ── Email Verification ────────────────────────────────── */

.rs-form-panel__inner--centered {
  text-align: center;
}

.rs-card__title--centered {
  text-align: center;
}

.rs-card__subtitle--centered {
  text-align: center;
}

.rs-verify-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(179, 0, 0, 0.04);
  border: 1px solid rgba(179, 0, 0, 0.12);
  border-radius: 50%;
  color: #b30000;
}

/* ── Inline row (two buttons side by side) ─────────────── */

.rs-btn-row {
  display: flex;
  gap: 12px;
}

.rs-btn-row .rs-btn {
  flex: 1;
}

/* ── Required asterisk ─────────────────────────────────── */

.rs-required {
  color: #b30000;
  margin-left: 2px;
}

/* ── Back link ─────────────────────────────────────────── */

.rs-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #b30000;
  margin-bottom: 28px;
}

.rs-back-link:hover {
  color: #8a0000;
}

/* ── Auth Method Selector ──────────────────────────────── */

.rs-auth-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rs-auth-method {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: "Inter", sans-serif;
  color: #000000;
  text-decoration: none;
}

.rs-auth-method:hover {
  border-color: #b30000;
}

.rs-auth-method__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(179, 0, 0, 0.04);
  border-radius: 10px;
  color: #b30000;
}

.rs-auth-method__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rs-auth-method__title {
  font-size: 15px;
  font-weight: 600;
  color: #000000;
}

.rs-auth-method__desc {
  font-size: 13px;
  color: #808080;
}

.rs-auth-method__arrow {
  flex-shrink: 0;
  color: #b0b0b0;
  transition: color 0.2s;
}

.rs-auth-method:hover .rs-auth-method__arrow {
  color: #b30000;
}

/* ── Alternate auth link ───────────────────────────────── */

.rs-alt-auth {
  text-align: center;
}

.rs-alt-auth__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #b30000;
  transition: color 0.2s;
}

.rs-alt-auth__link:hover {
  color: #8a0000;
}

/* ── Recovery Codes ─────────────────────────────────────── */

.rs-recovery-codes {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.rs-recovery-codes__list {
  list-style: none;
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #333333;
  line-height: 2;
  letter-spacing: 0.06em;
}

.rs-recovery-codes__copy {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #b30000;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.rs-recovery-codes__copy:hover {
  color: #8a0000;
}

/* ── Error header ──────────────────────────────────────── */

.rs-error-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.rs-error-header__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(179, 0, 0, 0.04);
  border: 1px solid rgba(179, 0, 0, 0.12);
  border-radius: 10px;
  color: #b30000;
}

.rs-error-header__title {
  font-size: 22px;
  font-weight: 600;
  color: #000000;
}

/* ── Logout header ─────────────────────────────────────── */

.rs-logout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.rs-logout-header__title {
  font-size: 24px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 4px;
}

.rs-logout-header__desc {
  font-size: 15px;
  color: #808080;
}

.rs-logout-header__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(179, 0, 0, 0.04);
  border: 1px solid rgba(179, 0, 0, 0.12);
  border-radius: 12px;
  color: #b30000;
}

/* ── Keycloak Base Theme Overrides ──────────────────────── */

.form-group {
  margin-bottom: 20px;
}

.form-group label,
.pf-c-form__label,
.pf-c-form__label-text {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
}

.pf-c-form-control,
.pf-c-form-control[type="text"],
.pf-c-form-control[type="email"],
.pf-c-form-control[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  color: #000000;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.pf-c-form-control:focus {
  border-color: #b30000;
  box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.08);
}

.pf-c-form-control::placeholder {
  color: #b0b0b0;
}

.pf-c-input-group {
  display: flex;
  gap: 0;
}

.pf-c-input-group .pf-c-form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}

.pf-c-input-group .pf-c-button.pf-m-control {
  height: 46px;
  padding: 0 14px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: #808080;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.pf-c-input-group .pf-c-button.pf-m-control:hover {
  color: #b30000;
}

.pf-c-button.pf-m-primary,
input.pf-c-button.pf-m-primary {
  width: 100%;
  height: 46px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #b30000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.pf-c-button.pf-m-primary:hover,
input.pf-c-button.pf-m-primary:hover {
  background: #990000;
  box-shadow: 0 2px 8px rgba(179, 0, 0, 0.25);
  color: #ffffff;
}

#kc-form-options a {
  color: #b30000;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

#kc-form-options a:hover {
  color: #8a0000;
}

#kc-form-options {
  margin-bottom: 16px;
}

.form-group .col-xs-12 > *:not(label):not(input):not(.pf-c-input-group):not(#kc-form-options):not(#kc-form-buttons) {
  color: #b30000;
  font-size: 13px;
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 960px) {
  .rs-split {
    grid-template-columns: 1fr;
  }

  .rs-panel {
    display: none;
  }

  .rs-form-panel {
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  .rs-form-panel {
    padding: 32px 20px;
  }

  .rs-card__title {
    font-size: 22px;
  }
}
