@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

/* ============================================================
   SignChronix Auth (Aligned with Super Admin UI)
   ============================================================ */

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

:root {
  --bg: #F2F3EF;
  --bg-soft: #E8EDE5;
  --surface: #FFFFFF;
  --surface-subtle: #F6F7F2;
  --line-subtle: #DFE0DA;
  --text-primary: #1A2332;
  --text-secondary: #5A6370;
  --text-muted: #8A9099;
  --accent: #6B7D63;
  --accent-strong: #4A5544;
  --success: #6B9E5A;
  --danger: #C45A5A;
  --shadow: 0 18px 40px rgba(26, 35, 50, 0.12);
  --shadow-soft: 0 12px 24px rgba(26, 35, 50, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
}

body.sc-auth-page {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 48px 18px;
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  gap: 24px;
}

body.sc-modal-open {
  overflow: hidden;
}

.sc-auth-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(620px 340px at 12% 12%, rgba(255,255,255,0.7), transparent 70%),
    radial-gradient(520px 280px at 85% 15%, rgba(255,255,255,0.5), transparent 70%),
    var(--bg);
  z-index: 0;
}

.sc-auth-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 35, 50, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 35, 50, 0.03) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.35;
}

.sc-auth-bg::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: min(520px, 65vw);
  height: min(420px, 55vw);
  background: url('../img/bg2.png') no-repeat right bottom;
  background-size: contain;
  opacity: 0.9;
  pointer-events: none;
}

/* Hide legacy brand panel */
.sc-brand-panel { display: none !important; }

/* ---------- Form Container ---------- */
.sc-form-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  flex: 1;
  padding: 12px 0 24px;
}

.sc-form-box {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px 32px 28px;
}

.sc-auth-center {
  text-align: center;
  margin-bottom: 18px;
}

.sc-auth-center-title {
  font-size: 40px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  color: var(--text-primary);
}

/* ---------- Header / Footer ---------- */
.sc-auth-header {
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.sc-auth-header-inner {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-soft);
}

.sc-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.sc-auth-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  border: 1px solid var(--line-subtle);
}

.sc-auth-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sc-auth-brand-title {
  font-weight: 700;
  font-size: 14px;
}

.sc-auth-brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.sc-auth-header-links {
  display: none;
}

.sc-auth-header-actions {
  display: flex;
  gap: 10px;
}

.sc-auth-header-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.sc-auth-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1;
  margin-top: auto;
}

.sc-auth-footer-inner {
  width: 100%;
  max-width: 980px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 18px 20px;
}

.sc-auth-footer-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sc-auth-footer-links a {
  text-decoration: none;
  color: var(--text-muted);
}

.sc-auth-footer-links a:hover {
  color: var(--accent);
}

.sc-auth-footer-links span {
  opacity: 0.5;
}

.sc-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.sc-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  border: 1px solid var(--line-subtle);
}

.sc-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.sc-brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Tabs ---------- */
.sc-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line-subtle);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 20px;
}
.sc-tab {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.sc-tab.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
}
.sc-tab-panel { display: none; }
.sc-tab-panel.is-active { display: block; }

/* ---------- Header ---------- */
.sc-card-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--line-subtle);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  width: fit-content;
  margin: 0 auto 14px;
}

.sc-card-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.sc-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 22px;
}

/* ---------- Alerts ---------- */
.sc-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.sc-alert-danger {
  background: #F5E1E1;
  border: 1px solid rgba(196, 90, 90, 0.35);
  color: #8B2C2C;
}

.sc-alert-success {
  background: #E5F0E1;
  border: 1px solid rgba(107, 158, 90, 0.4);
  color: #2D6A3C;
}

/* ---------- Form Fields ---------- */
.sc-field { margin-bottom: 16px; }

.sc-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.sc-input-wrap { position: relative; }
.sc-input-icon { display: none; }

.sc-input {
  width: 100%;
  background: var(--surface-subtle);
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 12px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
  -webkit-appearance: none;
}

.sc-input::placeholder {
  color: #9AA3AD;
}

.sc-input:focus {
  border-color: rgba(107, 125, 99, 0.7);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(107, 125, 99, 0.2);
}

select.sc-input {
  cursor: pointer;
  padding-right: 34px;
  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 d='M1 1l5 5 5-5' stroke='%239AA3AD' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) 50%;
  appearance: none;
}

textarea.sc-input { resize: vertical; min-height: 72px; }

.sc-file {
  width: 100%;
  padding: 11px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.sc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.sc-check input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.sc-check a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.sc-check a:hover {
  text-decoration: underline;
}

/* Password toggle */
.sc-pass-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9AA3AD;
  cursor: pointer;
  padding: 4px;
  font-size: 15px;
  z-index: 2;
}

/* ---------- Button ---------- */
.sc-btn-primary {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 20px rgba(107, 125, 99, 0.25);
}

.sc-btn-primary:hover { background: var(--accent-strong); }
.sc-btn-primary:active { transform: translateY(1px); }
.sc-btn-primary.is-loading {
  cursor: wait;
  opacity: 0.92;
}
.sc-btn-primary.is-loading .sc-btn-icon {
  display: none;
}
.sc-btn-primary .sc-btn-spinner {
  display: none;
}
.sc-btn-primary.is-loading .sc-btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: sc-spin 0.8s linear infinite;
}

@keyframes sc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---------- Footer ---------- */
.sc-footer {
  text-align: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-subtle);
}

.sc-footer-row {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sc-footer-row:last-child { margin-bottom: 0; }

.sc-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sc-link:hover { text-decoration: underline; }

/* ---------- Grid ---------- */
.sc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---------- Modal ---------- */
.sc-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.sc-modal.is-open {
  display: flex;
}

.sc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, 0.4);
  backdrop-filter: blur(3px);
}

.sc-modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow);
  padding: 28px;
  width: min(520px, 100%);
  z-index: 2;
}

.sc-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-subtle);
  background: var(--surface-subtle);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ---------- Misc ---------- */
.sc-icon-hero { display: none; }

@media (max-width: 900px) {
  .sc-form-box { padding: 26px; }
  .sc-auth-header-inner { flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 768px) {
  .sc-row { grid-template-columns: 1fr; }
  .sc-modal-card { padding: 24px; }
  .sc-auth-header-inner,
  .sc-auth-footer-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .sc-auth-header-actions { justify-content: center; }
}

@media (max-width: 480px) {
  body.sc-auth-page { padding: 24px 12px; }
  .sc-form-box { padding: 22px; }
  .sc-brand-row { flex-direction: column; align-items: flex-start; }
}
