*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #0f172a;
  background: radial-gradient(1200px 600px at 10% -10%, #e0f2fe 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, #ede9fe 0%, transparent 55%),
              #f8fafc;
  min-height: 100vh;
}

.home { max-width: 1080px; margin: 0 auto; padding: 48px 24px 96px; }

/* ===== Header ===== */
.home-head { text-align: center; padding: 24px 0 40px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: #2563eb;
  background: #dbeafe; padding: 6px 12px; border-radius: 999px;
}
.home-head h1 {
  font-size: clamp(32px, 5vw, 48px); line-height: 1.05;
  font-weight: 800; letter-spacing: -.02em; margin: 20px 0 10px;
}
.home-head .lead {
  max-width: 560px; margin: 0 auto 24px;
  font-size: 17px; color: #475569;
}

.btn-primary, .btn-ghost {
  border: 0; cursor: pointer; font: inherit; font-weight: 600;
  border-radius: 12px; padding: 13px 22px; font-size: 15px;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  color: white; box-shadow: 0 10px 24px -10px rgba(37, 99, 235, .6);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: white; color: #0f172a; border: 1px solid #e2e8f0;
}
.btn-ghost:hover { border-color: #cbd5e1; }

/* ===== Projects grid ===== */
.projects {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 24px;
}
.project-card {
  background: white; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .12s ease, box-shadow .2s ease, border-color .15s ease;
}
.project-card:hover {
  transform: translateY(-2px); border-color: #cbd5e1;
  box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .3);
}
.project-card header {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 8px;
}
.project-title {
  flex: 1; margin: 0; font-size: 17px; font-weight: 700;
  line-height: 1.3; word-break: break-word;
}
.project-rename {
  all: unset; cursor: pointer;
  color: #64748b; padding: 4px 8px; border-radius: 6px;
  font-size: 14px;
}
.project-rename:hover { background: #f1f5f9; color: #0f172a; }
.project-meta { margin: 0 0 18px; font-size: 13px; color: #64748b; }
.project-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm {
  font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px;
  text-decoration: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.btn-sm.primary { background: linear-gradient(90deg, #2563eb, #7c3aed); color: white; }
.btn-sm.ghost   { background: white; color: #0f172a; border: 1px solid #e2e8f0; }
.btn-sm.ghost:hover { border-color: #cbd5e1; }
.btn-sm.danger  { background: white; color: #b91c1c; border: 1px solid #fecaca; }
.btn-sm.danger:hover { background: #fef2f2; }

/* ===== Empty state ===== */
.empty-state {
  text-align: center; margin: 48px auto 0; max-width: 460px;
  padding: 48px 24px;
  background: white; border: 1px solid #e2e8f0; border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.empty-state .ico { font-size: 42px; margin-bottom: 12px; }
.empty-state h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.empty-state p  { margin: 0; color: #64748b; font-size: 14px; line-height: 1.55; }

/* ===== New project modal ===== */
.modal-bd {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-bd.open { display: flex; }
.modal-card {
  background: white; border-radius: 16px; width: min(480px, 92vw);
  padding: 24px;
  box-shadow: 0 40px 80px -20px rgba(15, 23, 42, .4);
}
.modal-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.modal-card .sub { margin: 0 0 18px; color: #475569; font-size: 14px; }
.modal-card label {
  display: block; font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: #475569;
  margin-bottom: 6px;
}
.modal-card input[type="text"] {
  width: 100%; padding: 12px 14px; font: inherit;
  border: 1px solid #e2e8f0; border-radius: 10px;
  background: white; color: #0f172a; margin-bottom: 20px;
}
.modal-card input[type="text"]:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Login page ===== */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 85vh; padding: 40px 24px; }
.login-card {
  width: 100%; max-width: 420px;
  background: white; border: 1px solid #e2e8f0; border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 40px 80px -30px rgba(15, 23, 42, .3);
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-head h1 {
  font-size: 28px; font-weight: 800; letter-spacing: -.02em;
  margin: 14px 0 4px;
}
.login-head .sub { margin: 0; color: #64748b; font-size: 14px; }

.login-form label {
  display: block; font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: #475569;
  margin: 14px 0 6px;
}
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%; padding: 12px 14px; font: inherit;
  border: 1px solid #e2e8f0; border-radius: 10px;
  background: white; color: #0f172a;
}
.login-form input:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.login-error {
  margin: 12px 0 0; font-size: 13px; color: #b91c1c;
  background: #fee2e2; border: 1px solid #fecaca;
  padding: 10px 12px; border-radius: 10px;
}
.login-submit { width: 100%; justify-content: center; margin-top: 20px; }

/* ===== Logout button (top-right on home) ===== */
.home-bar {
  display: flex; justify-content: flex-end;
  padding-top: 4px;
}
.logout-form { display: inline-block; margin: 0; }
.logout-btn {
  all: unset; cursor: pointer;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: #475569;
  border: 1px solid #e2e8f0; background: white;
  transition: border-color .15s ease, color .15s ease;
}
.logout-btn:hover { border-color: #cbd5e1; color: #0f172a; }
