/* ── BASE ───────────────────────────────────────────────────── */
:root {
  --bg:            #f0ede8;
  --surface:       #ffffff;
  --surface-2:     #f7f5f2;
  --border:        #e4e0d8;
  --border-strong: #cbc6bc;
  --text:          #18171a;
  --text-muted:    #6b6760;
  --text-faint:    #a8a39c;
  --accent:        #5b5ef4;
  --accent-bg:     #eef0ff;
  --green:         #16a34a;
  --red:           #dc2626;
  --amber:         #d97706;
  --teal:          #0d9488;
  --r:             14px;
  --shadow:        0 1px 3px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.05);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── VIEWS ──────────────────────────────────────────────────── */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }
#view-login.active { display: flex; }

/* ── LOGIN ──────────────────────────────────────────────────── */
#view-login {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-header { text-align: center; margin-bottom: 36px; }

.login-logo-icon {
  width: 54px;
  height: 54px;
  background: var(--text);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--surface);
  margin: 0 auto 20px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

.login-sub {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.field input {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.field input::placeholder { color: var(--text-faint); }

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,94,244,0.1);
  background: var(--surface);
}

.field input.error-shake {
  animation: shake 0.35s ease;
  border-color: var(--red);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.login-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  min-height: 18px;
}

.btn-primary {
  background: var(--text);
  color: var(--surface);
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.btn-primary:hover  { opacity: 0.82; }
.btn-primary:active { transform: scale(0.98); }

.login-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 24px;
  font-style: italic;
}

/* ── APP BAR ────────────────────────────────────────────────── */
.app-bar {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 15px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-bar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.app-bar-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--text);
  color: var(--surface);
  padding: 3px 10px;
  border-radius: 20px;
}

.back-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.back-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* ── PROFILES VIEW ──────────────────────────────────────────── */
.profiles-body {
  max-width: 1140px;
  margin: 0 auto;
  padding: 52px 28px;
}

.profiles-header {
  margin-bottom: 40px;
}

.profiles-heading {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 4px;
}

.profiles-count {
  font-size: 13px;
  color: var(--text-faint);
}

.folder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
}

/* ── FOLDER CARD ────────────────────────────────────────────── */
.folder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  width: 120px;
  gap: 10px;
  transition: transform 0.2s ease;
}

.folder-card:hover { transform: translateY(-4px); }
.folder-card:hover .folder-body { filter: brightness(1.06); }

.folder-icon {
  position: relative;
  width: 120px;
  height: 96px;
}

.folder-tab {
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 17px;
  background: var(--folder-dark);
  border-radius: 5px 5px 0 0;
}

.folder-body {
  position: absolute;
  top: 11px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--folder-color);
  border-radius: 3px 10px 10px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s;
  box-shadow: 0 5px 16px rgba(0,0,0,0.13), inset 0 1px 0 rgba(255,255,255,0.18);
}

.folder-emoji {
  font-size: 30px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.18));
}

.folder-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.folder-sub {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* ── PROFILE DETAIL ─────────────────────────────────────────── */
.detail-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 28px 96px;
}

/* hero */
.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 36px;
  margin-bottom: 20px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  flex-shrink: 0;
}

.profile-info { flex: 1; }

.profile-name {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-title {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.55;
}

.profile-location {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1.5px solid;
}

.tag-default { background: var(--surface-2); border-color: var(--border);      color: var(--text-muted); }
.tag-red     { background: #fef2f2;          border-color: #fecaca;            color: var(--red); }
.tag-green   { background: #f0fdf4;          border-color: #bbf7d0;            color: var(--green); }
.tag-amber   { background: #fffbeb;          border-color: #fde68a;            color: var(--amber); }
.tag-accent  { background: var(--accent-bg); border-color: #c7d2fe;            color: var(--accent); }
.tag-teal    { background: #f0fdfa;          border-color: #99f6e4;            color: var(--teal); }

/* stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.stat-note {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* content sections */
.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.section-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.3;
}

.section-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.85;
}

.section-body p            { margin-bottom: 12px; }
.section-body p:last-child { margin-bottom: 0; }
.section-body strong       { color: var(--text); font-weight: 600; }

/* evidence list */
.evidence-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.evidence-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding: 13px 16px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.evidence-list .li-icon { font-size: 17px; flex-shrink: 0; padding-top: 1px; }
.evidence-list li strong { color: var(--text); font-weight: 600; }

/* verdict */
.verdict-card {
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r);
  padding: 40px 36px;
  margin-bottom: 20px;
  text-align: center;
}

.verdict-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 14px;
}

.verdict-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 18px;
}

.verdict-body {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.85;
  max-width: 620px;
  margin: 0 auto;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 620px) {
  .profile-hero    { flex-direction: column; }
  .login-card      { padding: 36px 24px; }
  .detail-body     { padding: 32px 16px 72px; }
  .profiles-body   { padding: 36px 16px; }
}
