/* Flexbox lab — properties limited to flexbox/allowed.md */

body {
  margin: 0;
  padding: 24px;
  font-size: 16px;
  font-weight: 400;
  background: #e8eef5;
  color: #15202b;
}

a {
  color: inherit;
}

.page {
  margin: 0 auto;
  padding: 0;
  width: 100%;
  max-width: 900px;
  display: block;
  color: inherit;
}

nav {
  margin: 0 0 24px 0;
  padding: 12px 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  background: #d5e0ec;
  display: block;
  border: 1px solid #a9b8c9;
  border-radius: 8px;
  color: inherit;
  text-align: center;
}

header {
  margin: 0 0 24px 0;
  padding: 20px 24px;
  background: #16324f;
  display: block;
  border: 2px solid #0d2136;
  border-radius: 12px;
  color: #f4f7fb;
  text-align: center;
}

header h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: inherit;
  background: transparent;
}

header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: #c5d4e4;
  background: transparent;
}

.box {
  margin: 0 0 16px 0;
  padding: 16px;
  background: #f8fafc;
  display: block;
  border: 1px solid #c9d4e0;
  border-radius: 12px;
  color: inherit;
}

.box-alt {
  margin: 0 0 16px 0;
  padding: 16px;
  background: #dceaf7;
  display: block;
  border: 1px solid #b0c7de;
  border-radius: 12px;
  color: inherit;
}

.credit {
  margin: 16px 0 0 0;
  padding: 10px 12px;
  font-size: 12px;
  background: #d5e0ec;
  border: 1px solid #a9b8c9;
  border-radius: 8px;
  color: #334155;
}

.accent {
  font-weight: 700;
  color: #0e7490;
}

.mark {
  background: #fde68a;
  color: inherit;
}

.explain {
  margin: 8px 0 0 0;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  color: #334155;
}

.label {
  margin: 0 0 8px 0;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: #16324f;
}

/* —— Playground stages —— */
.stage {
  margin: 0 0 8px 0;
  padding: 8px;
  width: auto;
  height: 120px;
  background: #cbd5e1;
  display: flex;
  border: 2px dashed #64748b;
  border-radius: 8px;
}

.cell {
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  background: #0e7490;
  color: #ecfeff;
  border: 1px solid #155e75;
  border-radius: 8px;
  text-align: center;
}

.cell-b {
  background: #b45309;
  border: 1px solid #92400e;
  color: #fffbeb;
}

.cell-c {
  background: #16324f;
  border: 1px solid #0d2136;
  color: #f8fafc;
}

.cell-tall {
  height: 70px;
}

.cell-mid {
  height: 40px;
}

.cell-short {
  height: 24px;
}

.jc-start {
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
}

.jc-end {
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
}

.jc-center {
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
}

.jc-between {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
}

.jc-around {
  flex-direction: row;
  justify-content: space-around;
  align-items: flex-start;
}

.jc-evenly {
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
}

.ai-stretch {
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
}

.ai-start {
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
}

.ai-end {
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
}

.ai-center {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.fd-row {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.fd-row-reverse {
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.fd-column {
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  height: 200px;
}

.fd-column-reverse {
  flex-direction: column-reverse;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  height: 200px;
}

.gap-none {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
}

.gap-sm {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.gap-lg {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
}

.both-center {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* —— Practical: navbar page —— */
.app-nav {
  margin: 0 0 16px 0;
  padding: 12px 16px;
  background: #16324f;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 2px solid #0d2136;
  border-radius: 12px;
  color: #f8fafc;
}

.app-nav .brand {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: inherit;
}

.app-nav .links {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.app-nav .links a {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: #1e4970;
  border: 1px solid #2a5f8f;
  border-radius: 999px;
  color: #f8fafc;
}

.hero {
  margin: 0 0 16px 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  background: #16324f;
  display: block;
  border: 2px solid #0d2136;
  border-radius: 12px;
  color: #f8fafc;
}

.hero .overlay {
  margin: 0;
  padding: 48px 28px;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  color: #f8fafc;
  text-align: center;
}

.hero .overlay h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  color: inherit;
  background: transparent;
}

.hero .overlay h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  color: #e2e8f0;
  background: transparent;
}

.actions {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.hero .actions {
  justify-content: center;
}

button {
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  background: #0e7490;
  display: block;
  border: 1px solid #155e75;
  border-radius: 8px;
  color: #ecfeff;
}

button.secondary {
  background: #e2e8f0;
  border: 1px solid #94a3b8;
  color: #16324f;
}

button.pill {
  border-radius: 999px;
}

/* —— Cards —— */
.card-row {
  margin: 0 0 16px 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
  gap: 16px;
}

.card {
  margin: 0;
  padding: 12px;
  width: 216px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  border: 1px solid #c9d4e0;
  border-radius: 12px;
  color: inherit;
  text-align: center;
}

.card img {
  margin: 0;
  padding: 0;
  width: 192px;
  height: 120px;
  display: block;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #0f172a;
}

.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: inherit;
}

.card h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #475569;
}

.price {
  font-weight: 700;
  color: #b45309;
}

/* —— Split profile —— */
.split {
  margin: 0 0 16px 0;
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
  border: 1px solid #c9d4e0;
  border-radius: 12px;
}

.avatar {
  margin: 0;
  padding: 0;
  width: 140px;
  height: 140px;
  display: block;
  border: 3px solid #16324f;
  border-radius: 50%;
  background: #cbd5e1;
}

.split-copy {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  width: 480px;
}

.split-copy h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.split-copy h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: #475569;
}

.chip-row {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.chip {
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #dceaf7;
  border: 1px solid #b0c7de;
  border-radius: 999px;
  color: #16324f;
}

/* —— Stack form —— */
.stack-form {
  margin: 0 0 16px 0;
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 12px;
  border: 1px solid #c9d4e0;
  border-radius: 12px;
}

.field {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 6px;
}

.field h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  margin: 0;
  padding: 8px 10px;
  width: 640px;
  font-size: 14px;
  background: #ffffff;
  display: block;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  color: inherit;
}

.stack-actions {
  margin: 4px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

ul {
  margin: 8px 0 0 0;
  padding: 0 0 0 22px;
  color: inherit;
}

li {
  margin: 0 0 6px 0;
  color: inherit;
}

/* —— Advanced Flexbox lessons —— */
.advanced-stage {
  margin: 0 0 10px 0;
  padding: 12px;
  min-height: 84px;
  background: #cbd5e1;
  display: flex;
  gap: 10px;
  border: 2px dashed #64748b;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: auto;
}

.advanced-stage span {
  margin: 0;
  padding: 12px;
  min-width: 8rem;
  background: #0e7490;
  color: #ecfeff;
  border: 1px solid #155e75;
  border-radius: 8px;
  box-sizing: border-box;
  text-align: center;
}

.nowrap-demo { flex-wrap: nowrap; }
.wrap-demo { flex-wrap: wrap; }

.wrap-reverse-demo {
  min-height: 150px;
  flex-wrap: wrap-reverse;
}

.column-wrap-demo {
  height: 190px;
  flex-direction: column;
  flex-wrap: wrap;
}

.column-wrap-demo span {
  min-width: 0;
  min-height: 70px;
}

.basis-demo { flex-wrap: wrap; }
.basis-demo .basis-small { flex-basis: 10rem; }
.basis-demo .basis-large { flex-basis: 18rem; }
.grow-demo span { flex-basis: 8rem; }
.grow-demo .grow-one { flex-grow: 1; }
.grow-demo .grow-two { flex-grow: 2; }
.shrink-demo span { flex-basis: 20rem; }
.shrink-demo .shrink-zero { flex-shrink: 0; }
.shrink-demo .shrink-one { flex-shrink: 1; }
.shrink-demo .shrink-two { flex-shrink: 2; }
.shorthand-demo { flex-wrap: wrap; }
.shorthand-demo .shorthand-one { flex: 1 1 12rem; }
.shorthand-demo .shorthand-two { flex: 2 1 12rem; }

.self-demo {
  min-height: 160px;
  align-items: center;
}

.self-demo .self-start { align-self: flex-start; }
.self-demo .self-end { align-self: flex-end; }

.content-start-demo,
.content-between-demo {
  height: 260px;
  flex-wrap: wrap;
}

.content-start-demo { align-content: flex-start; }
.content-between-demo { align-content: space-between; }

.content-start-demo span,
.content-between-demo span {
  flex: 1 1 12rem;
}

.order-demo { flex-wrap: wrap; }
.order-demo span { flex: 1 1 10rem; }
.source-first { order: 2; }
.source-second { order: -1; }
.source-third,
.source-fourth { order: 0; }

.warning-box {
  border-color: #b45309;
  background: #fffbeb;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  max-width: 100%;
  box-sizing: border-box;
}
