/* ═══════════════════════════════════════════════════════════════
   Integro Login — AuthKit-inspired thin, elegant dark aesthetic
   Font: Inter (variable), Outfit (thin headings)
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --font: 'Golos Text', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Golos Text', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Dark palette */
  --bg-0: #111827;
  --bg-1: #172235;
  --bg-2: #1b293e;
  --bg-card: rgba(24, 34, 52, 0.9);
  --bg-input: rgba(15, 23, 42, 0.34);
  --border: rgba(148, 163, 184, 0.18);
  --border-hover: rgba(148, 163, 184, 0.3);
  --border-focus: rgba(96, 165, 250, 0.36);
  --text-0: rgba(241, 245, 249, 0.94);
  --text-1: rgba(203, 213, 225, 0.68);
  --text-2: rgba(148, 163, 184, 0.46);
  --text-3: rgba(148, 163, 184, 0.24);
  --accent: #60a5fa;
  --accent-dim: rgba(96, 165, 250, 0.15);
  --accent-glow: rgba(96, 165, 250, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
}

/* ── Light overrides ── */
html[data-theme='light'] .ak-body,
.ak-body[data-theme='light'] {
  --bg-0: #f6f7f9;
  --bg-1: #eef0f4;
  --bg-2: #e4e7ed;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-input: rgba(0, 0, 0, 0.025);
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(79, 100, 200, 0.3);
  --text-0: rgba(0, 0, 0, 0.88);
  --text-1: rgba(0, 0, 0, 0.48);
  --text-2: rgba(0, 0, 0, 0.28);
  --text-3: rgba(0, 0, 0, 0.14);
  --accent: #4f64c8;
  --accent-dim: rgba(79, 100, 200, 0.08);
  --accent-glow: rgba(79, 100, 200, 0.04);
}

/* ── Base ── */
.ak-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.ak-canvas {
  position: relative;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* ── Aurora / light beam ── */
.ak-aurora {
  display: none;
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 800px;
  background: radial-gradient(ellipse 40% 60% at 50% 0%,
    rgba(141, 164, 239, 0.08) 0%,
    rgba(141, 164, 239, 0.03) 40%,
    transparent 70%
  );
  pointer-events: none;
  animation: auroraBreathe 8s ease-in-out infinite;
}

.ak-aurora--b {
  top: -20%;
  width: 400px;
  height: 600px;
  background: radial-gradient(ellipse 50% 50% at 50% 0%,
    rgba(200, 180, 255, 0.04) 0%,
    transparent 60%
  );
  animation: auroraBreathe 12s ease-in-out 2s infinite reverse;
}

/* ── Grid ── */
.ak-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, rgba(0,0,0,0.5), transparent);
}

html[data-theme='light'] .ak-grain,
.ak-body[data-theme='light'] .ak-grain {
  background-image:
    linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
}

/* ── Topbar ── */
.ak-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 20px;
}

.ak-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ak-brand-mark {
  color: var(--accent);
  opacity: 0.7;
}

.ak-brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-0);
  letter-spacing: 0;
}

.ak-brand-badge {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.ak-theme-toggle {
  display: none !important;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 400;
  white-space: nowrap;
}

.ak-theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
}

/* ── Layout ── */
.ak-main {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  flex: 1;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 0;
}

/* ── Hero (left) ── */
.ak-hero {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 40px 0;
}

.ak-hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ak-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ak-pill--sm {
  padding: 3px 10px;
  font-size: 10px;
}

.ak-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  animation: dotPulse 3s ease-in-out infinite;
}

.ak-pill-dot--secure {
  background: #34d399;
}

.ak-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--text-0);
}

.ak-title-accent {
  display: block;
  background: linear-gradient(135deg, #8da4ef 0%, #b4bfef 40%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 8s ease-in-out infinite;
  background-size: 200% 200%;
}

.ak-desc {
  margin: 0;
  max-width: 36ch;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-1);
}

/* ── Features ── */
.ak-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.ak-feat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 16px;
  background: var(--bg-0);
  transition: background 300ms ease;
}

.ak-feat:hover {
  background: var(--bg-1);
}

.ak-feat svg {
  flex-shrink: 0;
  color: var(--text-2);
  margin-top: 1px;
  transition: color 300ms ease;
}

.ak-feat:hover svg {
  color: var(--accent);
}

.ak-feat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ak-feat-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
  letter-spacing: 0;
}

.ak-feat-sub {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-2);
}

/* ── Stats ── */
.ak-stats {
  display: flex;
  align-items: center;
  gap: 0;
}

.ak-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ak-stat-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
  letter-spacing: 0;
}

.ak-stat-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ak-stat-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Login panel (right) ── */
.ak-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.ak-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 36px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(40px) saturate(120%);
  overflow: hidden;
}

/* Corner dots */
.ak-card::before,
.ak-card::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
}
.ak-card::before { top: 8px; left: 8px; }
.ak-card::after { top: 8px; right: 8px; }

/* Bottom corner dots via card-shine pseudo */
.ak-card-shine {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}

.ak-card-shine::before,
.ak-card-shine::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
  bottom: 8px;
}
.ak-card-shine::before { left: 8px; }
.ak-card-shine::after { right: 8px; }

.ak-card-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ak-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 1.7rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--text-0);
}

.ak-card-desc {
  margin: 0;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Secure badge ── */
.ak-secure-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  font-size: 12px;
  font-weight: 400;
  color: var(--accent);
}

.ak-secure-badge svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── Form ── */
.ak-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ak-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: text;
}

.ak-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.ak-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text-0);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color 250ms ease, box-shadow 250ms ease;
}

.ak-input::placeholder {
  color: var(--text-3);
  font-weight: 300;
}

.ak-input:hover {
  border-color: var(--border-hover);
}

.ak-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Button ── */
.ak-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 20px;
  margin-top: 4px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xs);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  color: var(--text-0);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.ak-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 600ms ease;
}

.ak-btn:hover {
  border-color: rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
}

.ak-btn:hover::before {
  transform: translateX(100%);
}

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

.ak-btn svg {
  transition: transform 300ms ease;
  opacity: 0.5;
}

.ak-btn:hover svg {
  transform: translateX(3px);
  opacity: 0.8;
}

.ak-btn[data-loading='true'] {
  opacity: 0.5;
  pointer-events: none;
}

html[data-theme='light'] .ak-btn,
.ak-body[data-theme='light'] .ak-btn {
  background: linear-gradient(180deg, rgba(0,0,0,0.03), rgba(0,0,0,0.06));
  border-color: var(--border-hover);
}

html[data-theme='light'] .ak-btn:hover,
.ak-body[data-theme='light'] .ak-btn:hover {
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.08));
}

/* ── Login error ── */
.ak-login-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.06);
  color: #f87171;
  font-size: 13px;
  font-weight: 400;
}

/* ── Meta ── */
.ak-meta {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  overflow: hidden;
}

.ak-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 250ms ease;
}

.ak-meta-row:last-child {
  border-bottom: none;
}

.ak-meta-row:hover {
  background: var(--accent-dim);
}

.ak-meta-k {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ak-meta-v {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-1);
}

/* ── Animations ── */
@keyframes auroraBreathe {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateX(-50%) scale(1.05); }
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.15; }
}

/* Entrance animation */
.ak-enter {
  opacity: 0;
  transform: translateY(20px);
  animation: enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

@keyframes enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */
@media (max-width: 1000px) {
  .ak-main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0;
  }

  .ak-hero { padding: 20px 0; gap: 32px; }
  .ak-login-wrap { padding: 0; }
  .ak-card { max-width: 100%; }
}

@media (max-width: 600px) {
  .ak-canvas { padding: 12px; }
  .ak-features { grid-template-columns: 1fr; }
  .ak-title { font-size: 2.2rem; }
  .ak-stats { flex-wrap: wrap; gap: 12px; }
  .ak-stat-sep { display: none; }
  .ak-stat { flex: 0 0 45%; }
  .ak-card { padding: 28px 22px; }
}

/* ── Bootstrap overrides ── */
.ak-body .alert-danger {
  --bs-alert-bg: transparent;
  --bs-alert-border-color: transparent;
  --bs-alert-color: inherit;
  background: none;
  border: none;
}
