@import "./tokens.css";

/* =========================================
   BASE
   ========================================= */

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--sg-bg);
  color: var(--sg-text);
}

/* =========================================
   FORM SYSTEM — MINIMAL LINE INPUTS
   ========================================= */

.field {
  width: 100%;
  margin-bottom: 22px;
  text-align: left;
}

/* label */
.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* shared input styles */
input,
select {
  display: block;
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid #d7dbe0;
  background: transparent;
  font-size: 15px;
  color: #111;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  text-align: left;

  /* 🔥 keep native behavior stable */
  appearance: auto;
}

/* focus */
input:focus,
select:focus {
  outline: none;
  border-bottom: 2px solid #111;
}

/* placeholder */
input::placeholder {
  color: #9aa0a6;
}

input:focus::placeholder {
  opacity: 0.4;
}

/* =========================================
   SELECT STATE
   ========================================= */

select.select-empty {
  color: #9aa0a6;
}

select:not(.select-empty) {
  color: #111;
}

/* =========================================
   LAYOUT
   ========================================= */

.layout {
  min-height: 100vh;
}

.dashboard {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* =========================================
   NAV (DESKTOP)
   ========================================= */

.sg-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: white;
  border-bottom: 1px solid var(--sg-border);
  position: relative;
}

/* =========================================
   NAV BUTTON STYLE
   ========================================= */

.sg-nav-btn {
  margin-left: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: #111;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  transition: all 0.2s ease;
}

.sg-nav-btn:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* active feel (optional but nice) */
.sg-nav-btn:active {
  transform: translateY(1px);
}

.sg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sg-logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
}

.sg-brand-text {
  font-weight: 600;
  font-size: 16px;
}


/* menu button (hidden desktop) */
.sg-menu-toggle {
  display: none;
  font-size: 18px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* =========================================
   MOBILE NAV
   ========================================= */
@media (max-width: 768px) {

  .sg-menu-toggle {
    display: block;
  }

  .sg-links {
    position: absolute;
    top: 60px;
    right: 10px;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    display: none;
    flex-direction: column;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    z-index: 10;
  }

  .sg-links.open {
    display: flex;
  }

  .sg-nav-btn {
    margin: 0;
    width: 100%;
    text-align: left;
  }

}

/* =========================================
   ALERT SYSTEM
   ========================================= */

.sg-alert {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid transparent;
}

/* error */
.sg-alert.error {
  background: #fff5f5;
  border-color: #f5c2c7;
  color: #842029;
}

/* warning */
.sg-alert.warning {
  background: #fff8e1;
  border-color: #ffe082;
  color: #7a5d00;
}

/* success */
.sg-alert.success {
  background: #edf7ed;
  border-color: #c8e6c9;
  color: #1b5e20;
}
#analysisError {
  margin-bottom: 12px;
}

.count-up {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* =========================================
   COMPUTING STATE
   ========================================= */

.computing-state {
  text-align: center;
  padding: 40px 20px;
}

.loader {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid #eee;
  border-top: 3px solid #111;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.computing-state h3 {
  margin-bottom: 6px;
}

/* =========================================
   LOCKED STATE
   ========================================= */

.locked-state {
  text-align: center;
  padding: 30px 20px;
}

.lock-preview {
  margin: 20px 0;
  opacity: 0.5;
}

.blur-line {
  height: 12px;
  background: #e5e7eb;
  margin: 8px 0;
  border-radius: 4px;
  filter: blur(2px);
}

.blur-line.short {
  width: 60%;
  margin: 8px auto;
}

.small {
  font-size: 13px;
}

/* =========================================
   BLUR SYSTEM (FIXED)
   ========================================= */

.locked-wrapper {
  position: relative;
}

/* blurred content */
.locked-blur {
  filter: blur(6px);
  opacity: 0.6;

  pointer-events: none;   
  user-select: none;

  position: relative;
  z-index: 1;             
}

/* overlay (interactive layer) */
.locked-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 20px;

  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(2px);

  z-index: 10;            /* MUST be above */
}

/* button spacing */
.locked-overlay .primary-btn {
  margin-top: 14px;
  cursor: pointer;       /*  ensures pointer */
  z-index: 11;           /* extra safety */
}

/* optional hover polish */
.locked-overlay .primary-btn:hover {
  transform: scale(1.04);
  transition: transform 0.15s ease;
}
/* =========================================
   MODULE ROOT
   ========================================= */

#module-root {
  max-width: 900px;
  margin: auto;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */

h1 {
  margin-bottom: 6px;
}

p {
  color: var(--sg-muted);
}

