/* ── Base ── */
:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-input: #0d1117;
  --border: #30363d;
  --border-hover: #484f58;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-faint: #6e7681;
  --green: #3fb950;
  --green-bg: rgba(63, 185, 80, 0.15);
  --amber: #d29922;
  --amber-bg: rgba(210, 153, 34, 0.15);
  --red: #f85149;
  --red-bg: rgba(248, 81, 73, 0.15);
  --accent: #58a6ff;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 1.25rem;
  font-weight: 600;
}

h2 {
  font-size: 0.8rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Cards / Sections ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* ── Top Bar ── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.top-bar h1 {
  margin: 0;
}

.logout-btn {
  background: none !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn:hover {
  border-color: var(--red) !important;
  color: var(--red) !important;
  background: var(--red-bg) !important;
}

/* ── Focus Banner ── */
.focus {
  background: var(--amber-bg);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
}

.focus a {
  color: var(--amber);
  font-weight: 600;
}

/* ── Progress ── */
.progress {
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-bar {
  margin-top: 0.5rem;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 5px;
  transition: width 0.3s ease;
}

/* ── Module List ── */
.module {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
}

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

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.module-name:hover {
  color: var(--accent);
  text-decoration: none;
}

.module-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 10px;
  background: rgba(110, 118, 129, 0.2);
  color: var(--text-faint);
  white-space: nowrap;
}

.module.in_progress .module-status {
  background: var(--amber-bg);
  color: var(--amber);
}

.module.done .module-status {
  background: var(--green-bg);
  color: var(--green);
}

/* ── Checklist ── */
.checklist {
  margin: 0.75rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.checklist li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist-row {
  display: flex;
  align-items: center;
  transition: background 0.15s;
}

.checklist-row.done {
  background: rgba(63, 185, 80, 0.07);
}

/* maior especificidade para vencer button[type="submit"] */
button[type="submit"].check-btn {
  background: none;
  color: var(--text);
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  padding: 0.65rem 0.75rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  transition: background 0.12s;
}

button[type="submit"].check-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.03);
}

.check-icon {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-hover);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: transparent;
  transition: all 0.15s;
}

.checklist-row.done button[type="submit"].check-btn {
  color: var(--text-muted);
}

.checklist-row.done .check-icon {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.checklist-row.done .check-label {
  opacity: 0.5;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: transparent;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.checklist-row:hover .delete-btn {
  color: var(--text-faint);
}

.delete-btn:hover {
  color: var(--red) !important;
}

/* ── Forms ── */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text);
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  width: 100%;
  resize: vertical;
}

button[type="submit"] {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

button[type="submit"]:hover {
  opacity: 0.85;
}

/* ── Session Form ── */
.session-form form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ── Session List ── */
.session-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.session-list li strong {
  color: var(--text);
}

/* ── Add forms (inline) ── */
.add-checklist-form,
.add-module-form form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.add-checklist-form {
  margin-bottom: 0.5rem;
}

/* ── Notes ── */
.add-note-form {
  margin-bottom: 0.75rem;
}

.add-note-form button {
  margin-top: 0.4rem;
}

.notes-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}

.notes-list li strong {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Module Detail ── */
.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--accent);
}

.module-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.65rem;
  border-radius: 10px;
  background: rgba(110, 118, 129, 0.2);
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.module-status-badge.in_progress {
  background: var(--amber-bg);
  color: var(--amber);
}

.module-status-badge.done {
  background: var(--green-bg);
  color: var(--green);
}

.delete-module-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 1rem;
}

.delete-module-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

.stat-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* ── Login ── */
.login-container {
  max-width: 340px;
  margin: 6rem auto;
  text-align: center;
}

.login-container h1 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form input {
  text-align: center;
  padding: 0.65rem;
  font-size: 1rem;
}

.login-form button {
  padding: 0.65rem;
  font-size: 1rem;
}

.login-error {
  color: var(--red);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* ── Home / Roadmap List ── */
.roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.roadmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.roadmap-card:hover {
  border-color: var(--border-hover);
}

.roadmap-link {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.roadmap-link:hover {
  text-decoration: none;
}

.roadmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.roadmap-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.roadmap-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.roadmap-progress {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: block;
}

.add-roadmap-form form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.empty-message {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 500px) {
  body {
    padding: 1rem 0.75rem;
  }

  .session-form form {
    flex-direction: column;
    align-items: stretch;
  }

  .session-form form button {
    margin-top: 0.25rem;
  }
}
