/*
 * Remote Shifts ERP — Premium Auth UI
 * Login · Forgot Password · Reset · 2FA
 */
@import url("https://fonts.googleapis.com/css2?family=Funnel+Display:wght@400;500;600;700&family=Funnel+Sans:wght@300;400;500;600&display=swap");

:root {
  --rs-accent:       #02735e;
  --rs-accent-hover: #015f4d;
  --rs-accent-glow:  rgba(2, 115, 94, 0.22);
  --rs-lime:         #ddf160;

  --rs-dark:         #161616;
  --rs-dark-2:       #1c1c1c;
  --rs-dark-3:       #303030;
  --rs-dark-border:  rgba(255,255,255,0.09);
  --rs-dark-text:    #faf7f6;
  --rs-dark-muted:   #a3a3a3;

  --rs-base:         #faf7f6;
  --rs-surface:      #ffffff;
  --rs-border:       #e0dddb;
  --rs-muted:        #6b6766;
  --rs-body:         #303030;
}

html.rs-auth, body.rs-auth {
  margin: 0; padding: 0;
  min-height: 100vh;
  font-family: "Funnel Sans", system-ui, sans-serif;
  font-size: 16px;
  background: var(--rs-base);
  color: var(--rs-body);
  -webkit-font-smoothing: antialiased;
}
body.rs-auth * { box-sizing: border-box; }
body.rs-auth > * { font-size: inherit; }

/* ── Layout Grid ─────────────────────────────────────────── */
.rs-auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
@media (min-width: 960px) {
  .rs-auth-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(480px, 1fr);
  }
}

/* ── Brand Panel (left) ──────────────────────────────────── */
.rs-auth-brand {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 56px;
  background: var(--rs-dark);
  overflow: hidden;
}

/* Radial glow behind content */
.rs-auth-brand::before {
  content: '';
  position: absolute;
  top: -120px; left: -120px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(2,115,94,0.32) 0%, transparent 70%);
  pointer-events: none;
}

/* Bottom accent circle */
.rs-auth-brand::after {
  content: '';
  position: absolute;
  bottom: -200px; right: -100px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(221,241,96,0.14) 0%, transparent 70%);
  pointer-events: none;
}

@media (min-width: 960px) {
  .rs-auth-brand { display: flex; }
}

/* Brand top: wordmark */
.rs-auth-brand-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rs-auth-brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Brand middle: headline */
.rs-auth-brand-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0;
}

.rs-auth-brand-body h2 {
  margin: 0 0 20px;
  font-family: "Funnel Display", sans-serif;
  font-size: clamp(32px, 3.5vw, 48px);
  font-weight: 500;
  line-height: 1.18;
  color: #fff;
  letter-spacing: -0.02em;
}

.rs-auth-brand-body h2 em {
  font-style: normal;
  color: var(--rs-lime);
}

.rs-auth-brand-body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--rs-dark-muted);
  max-width: 380px;
}

/* Brand stats row */
.rs-auth-brand-stats {
  display: flex;
  gap: 32px;
  position: relative;
  z-index: 1;
  padding-top: 40px;
  border-top: 1px solid var(--rs-dark-border);
}

.rs-auth-brand-stat-value {
  font-family: "Funnel Display", sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--rs-dark-text);
  line-height: 1;
}

.rs-auth-brand-stat-label {
  font-size: 12px;
  color: var(--rs-dark-muted);
  margin-top: 4px;
}

/* Brand footer */
.rs-auth-brand-foot {
  font-size: 12px;
  color: var(--rs-dark-muted);
  position: relative;
  z-index: 1;
  padding-top: 24px;
  border-top: 1px solid var(--rs-dark-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rs-auth-brand-foot::before {
  content: '🔒';
  font-size: 14px;
}

/* ── Form Panel (right) ──────────────────────────────────── */
.rs-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--rs-surface);
  min-height: 100vh;
  overflow-y: auto;
}

@media (min-width: 960px) {
  .rs-auth-main {
    background: var(--rs-base);
    padding: 60px 48px;
  }
}

/* ── Auth Card ───────────────────────────────────────────── */
.rs-auth-card {
  width: 100%;
  max-width: 400px;
}

/* Logo */
.rs-auth-logo {
  margin-bottom: 36px;
}

.rs-auth-logo a {
  display: inline-flex;
  align-items: center;
}

.rs-auth-logo img {
  display: block;
  max-height: 42px;
  width: auto;
}

/* If no logo, show text fallback */
.rs-auth-logo:empty::after {
  content: 'Remote Shifts';
  display: block;
  font-family: "Funnel Display", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--rs-accent);
}

/* Heading */
.rs-auth-card h1 {
  margin: 0 0 6px;
  font-family: "Funnel Display", sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--rs-body);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Subheading */
.rs-auth-sub {
  margin: 0 0 32px;
  font-size: 14.5px;
  color: var(--rs-muted);
  line-height: 1.5;
}

/* ── Form Elements ───────────────────────────────────────── */
body.rs-auth .rs-auth-card .form-group {
  margin-bottom: 20px;
}

body.rs-auth .rs-auth-card .control-label,
body.rs-auth .rs-auth-card label,
body.rs-auth .rs-auth-card .form-group > label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rs-body);
  letter-spacing: 0.01em;
}

/* Input wrapper for icon support */
.rs-auth-input-wrap {
  position: relative;
}

.rs-auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rs-muted);
  font-size: 14px;
  pointer-events: none;
}

body.rs-auth .rs-auth-card .form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--rs-border);
  border-radius: 12px;
  background: var(--rs-surface);
  font-family: "Funnel Sans", sans-serif;
  font-size: 15px;
  color: var(--rs-body);
  transition: border-color 0.18s, box-shadow 0.18s;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
}

body.rs-auth .rs-auth-card .form-control::placeholder {
  color: #b5b0aa;
}

body.rs-auth .rs-auth-card .form-control:focus {
  border-color: var(--rs-accent);
  box-shadow: 0 0 0 4px var(--rs-accent-glow);
}

/* Password toggle button */
.rs-auth-pwd-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--rs-muted);
  font-size: 15px;
  line-height: 1;
  transition: color 0.15s;
}
.rs-auth-pwd-toggle:hover { color: var(--rs-body); }

/* ── Checkbox (Remember me) ──────────────────────────────── */
body.rs-auth .rs-auth-card .checkbox {
  margin: 2px 0 6px;
}

body.rs-auth .rs-auth-card .checkbox label {
  font-size: 13.5px;
  color: var(--rs-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.rs-auth .rs-auth-card .checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--rs-accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Divider ─────────────────────────────────────────────── */
.rs-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 20px;
  color: var(--rs-muted);
  font-size: 12px;
}
.rs-auth-divider::before,
.rs-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rs-border);
}

/* ── Primary Button ──────────────────────────────────────── */
body.rs-auth .rs-auth-card .btn-primary,
body.rs-auth .rs-auth-card .btn.btn-primary {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: 8px;
  padding: 0 24px;
  border: none;
  border-radius: var(--rs-r-btn, 999px);
  background: var(--rs-accent);
  font-family: "Funnel Display", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  box-shadow: 0 4px 18px rgba(2,115,94,0.28);
  position: relative;
  overflow: hidden;
}

body.rs-auth .rs-auth-card .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
  pointer-events: none;
}

body.rs-auth .rs-auth-card .btn-primary:hover {
  background: var(--rs-accent-hover);
  box-shadow: 0 6px 24px rgba(2,115,94,0.38);
  transform: translateY(-1px);
}

body.rs-auth .rs-auth-card .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(2,115,94,0.22);
}

/* ── Footer links ────────────────────────────────────────── */
body.rs-auth .rs-auth-card a.text-muted {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--rs-accent);
  text-decoration: none;
  transition: color 0.15s;
}

body.rs-auth .rs-auth-card a.text-muted:hover {
  color: var(--rs-accent-hover);
  text-decoration: underline;
}

.rs-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--rs-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.rs-auth-back::before {
  content: '←';
  font-size: 15px;
}

.rs-auth-back:hover { color: var(--rs-body); }

/* ── Alerts ──────────────────────────────────────────────── */
body.rs-auth .alert {
  border: none;
  border-radius: 12px;
  font-size: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

body.rs-auth .alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

body.rs-auth .alert-success {
  background: #f0fdf4;
  color: #166534;
  border-left: 3px solid var(--rs-accent);
}

body.rs-auth .text-danger { color: #dc2626; }

/* ── reCAPTCHA ───────────────────────────────────────────── */
body.rs-auth .rs-auth-card .g-recaptcha {
  margin-bottom: 16px;
  transform-origin: left top;
}

/* ── 2FA code input ──────────────────────────────────────── */
.rs-auth-otp-wrap {
  display: flex;
  gap: 10px;
  margin: 8px 0 20px;
}

.rs-auth-otp-wrap .form-control {
  text-align: center;
  font-size: 22px !important;
  font-weight: 600 !important;
  letter-spacing: 0.15em;
  height: 56px !important;
  font-variant-numeric: tabular-nums;
}

/* ── Security badge at bottom of form ───────────────────── */
.rs-auth-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 11.5px;
  color: var(--rs-muted);
}

.rs-auth-security-note svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ── Pulse animation for submit button ───────────────────── */
@keyframes rs-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(2,115,94,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(2,115,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(2,115,94,0); }
}

body.rs-auth .rs-auth-card .btn-primary:focus {
  animation: rs-pulse 1s ease-out;
  outline: none;
}

.rs-auth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.rs-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 99px;
  font-size: 12px;
  color: #c8d4cf;
}
.rs-auth-pill i {
  color: var(--rs-lime);
  font-size: 11px;
}

.rs-auth-brand-chip {
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--rs-lime);
  color: var(--rs-dark);
  text-transform: uppercase;
}
.rs-auth-brand-chip-staff {
  background: transparent;
  color: #c8d4cf;
  border: 1px solid rgba(255,255,255,0.2);
}

.rs-auth-badge {
  display: inline-flex;
  align-items: center;
  margin: -18px 0 18px;
  padding: 5px 11px;
  border-radius: 99px;
  font-family: "Funnel Display", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rs-auth-badge-client {
  background: rgba(2,115,94,0.1);
  color: var(--rs-accent);
  border: 1px solid rgba(2,115,94,0.22);
}
.rs-auth-badge-staff {
  background: #111;
  color: var(--rs-lime);
}

.rs-auth-staff-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: #9a9692;
}
.rs-auth-staff-hint a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.rs-reg-panels {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.rs-reg-panel {
  padding: 18px 18px 8px;
  border: 1.5px solid var(--rs-border);
  border-radius: 16px;
  background: #fbfaf8;
}
.rs-reg-panel h2 {
  margin: 0 0 14px;
  font-family: "Funnel Display", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--rs-body);
  letter-spacing: 0;
  text-transform: none;
}
.rs-reg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}
@media (min-width: 640px) {
  .rs-reg-grid { grid-template-columns: 1fr 1fr; }
}
.rs-reg-span { grid-column: 1 / -1; }
.rs-reg-section { display: none; }

.rs-auth-card.rs-auth-card-wide {
  max-width: 640px;
}
.rs-auth-card-wide .rs-auth-logo { margin-bottom: 22px; }
.rs-auth-card-wide .rs-auth-sub { margin-bottom: 22px; }
.rs-auth-card-wide h1 { font-size: 24px; }
body.rs-auth .rs-auth-card-wide .form-group { margin-bottom: 14px; }
body.rs-auth .rs-auth-card select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23706e6c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
@media (min-width: 960px) {
  .rs-auth-grid.rs-auth-grid-wide {
    grid-template-columns: minmax(280px, 0.75fr) minmax(540px, 1.25fr);
  }
  .rs-auth-grid-wide .rs-auth-main {
    align-items: flex-start;
    padding-top: 36px;
    padding-bottom: 36px;
  }
}
@media (min-width: 1180px) {
  .rs-auth-card.rs-auth-card-wide { max-width: 900px; }
  .rs-reg-panels { grid-template-columns: 1fr 1fr; align-items: start; }
  .rs-auth-grid.rs-auth-grid-wide {
    grid-template-columns: minmax(260px, 0.65fr) minmax(740px, 1.35fr);
  }
}
.rs-auth-switch {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--rs-muted);
}
.rs-auth-switch a {
  color: var(--rs-accent);
  font-weight: 600;
  text-decoration: none;
}
.rs-auth-switch a:hover { text-decoration: underline; }

.rs-auth-lang {
  margin-bottom: 18px;
}
.rs-auth-lang select.form-control {
  height: 42px;
  font-size: 13.5px;
}

.honey-element {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
}

/* MFA / 2FA */
.rs-mfa-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 36px;
}
.rs-mfa-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--rs-dark-border);
  border-radius: 14px;
}
.rs-mfa-method-ico {
  width: 36px;
  height: 36px;
  background: rgba(221,241,96,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--rs-lime);
  font-size: 16px;
}
.rs-mfa-method-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--rs-dark-text);
}
.rs-mfa-method-sub {
  font-size: 12px;
  color: var(--rs-dark-muted);
}
.rs-mfa-shield {
  width: 56px;
  height: 56px;
  background: rgba(2,115,94,0.12);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--rs-accent);
  font-size: 24px;
}
.rs-mfa-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--rs-base);
  border: 1px solid var(--rs-border);
  border-radius: 12px;
  margin-bottom: 24px;
}
.rs-mfa-user-ava {
  width: 32px;
  height: 32px;
  background: var(--rs-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 13px;
}
.rs-mfa-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--rs-body);
}
.rs-mfa-user-email {
  font-size: 12px;
  color: var(--rs-muted);
}
.rs-mfa-user-switch {
  margin-left: auto;
  font-size: 12px;
  color: var(--rs-accent);
  text-decoration: none;
  white-space: nowrap;
}
.rs-mfa-code {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.4em;
  height: 64px;
  border-radius: 14px;
  border-width: 1.5px;
  font-family: "Funnel Display", sans-serif;
}
.rs-mfa-hint {
  font-size: 12px;
  color: var(--rs-muted);
  margin-top: 8px;
  text-align: center;
}
.rs-mfa-hint i {
  margin-right: 4px;
}

@media (max-width: 959px) {
  .rs-auth-main {
    background: var(--rs-surface);
    padding: 32px 20px;
    align-items: flex-start;
    padding-top: 60px;
  }
}
