:root {
  /* Palette lifted from ironcalc.com */
  --primary-main: #f2994a;
  --primary-light: #efaa6d;
  --primary-dark: #d68742;
  --secondary-main: #2f80ed;
  --secondary-dark: #2b6ec8;
  --dark: #272525;
  --grey-600: #757575;
  --grey-400: #9e9e9e;
  --grey-200: #e0e0e0;
  --background: #fcfcfc;
  --error: #f87171;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--dark);
  background: var(--background);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  line-height: 1.2;
  margin: 0 0 12px;
}

a {
  color: var(--secondary-main);
}

.container {
  width: min(1020px, calc(100% - 40px));
  margin: 0 auto;
}

.main {
  flex: 1;
  padding: 40px 0 64px;
}

/* Header / footer */

.site-header {
  border-bottom: 1px solid var(--grey-200);
  background: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--dark);
  text-decoration: none;
}

.logo span {
  color: var(--primary-main);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--grey-200);
  padding: 20px 0;
  color: var(--grey-600);
  font-size: 14px;
  background: #fff;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: 600 15px "Inter", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary {
  background: var(--primary-main);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--dark);
  border-color: var(--grey-200);
}

.btn-ghost:hover {
  background: #f2f2f2;
}

.btn-lg {
  padding: 12px 26px;
  font-size: 17px;
}

.btn-block {
  width: 100%;
}

/* Landing page */

.hero {
  text-align: center;
  padding: 56px 0 40px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
}

.hero em {
  color: var(--primary-main);
  font-style: normal;
}

.lead {
  color: var(--grey-600);
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

/* Cards */

.card {
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  padding: 24px;
}

.feature p {
  color: var(--grey-600);
  margin: 0;
}

/* Auth forms */

.auth-card {
  max-width: 420px;
  margin: 24px auto;
  padding: 32px;
}

.auth-card.center {
  text-align: center;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 14px 0 4px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  font: 15px "Inter", sans-serif;
}

input:focus {
  outline: 2px solid var(--primary-light);
  border-color: var(--primary-main);
}

.muted {
  color: var(--grey-600);
  font-size: 14px;
}

.alert {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid var(--error);
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid var(--success);
}

/* Logged-in area */

.page-head {
  margin-bottom: 24px;
}

.page-head .lead {
  margin: 0;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.workbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.workbook.open-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  color: var(--dark);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.workbook.open-editor:hover {
  border-color: var(--primary-main);
}

.open-editor .plus {
  font-size: 32px;
  line-height: 1;
  color: var(--primary-main);
}

.open-editor-title {
  font-weight: 600;
}

.section-title {
  font-size: 18px;
  margin: 28px 0 12px;
}

/* Template row (start a new spreadsheet) */

.template-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.template-form {
  display: contents;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: var(--dark);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease;
}

.template-card:hover {
  border-color: var(--primary-main);
}

.template-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #fff;
  border-bottom: 1px solid var(--grey-200);
  overflow: hidden;
}

.template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.template-thumb--blank .plus {
  font-size: 36px;
  color: var(--primary-main);
  line-height: 1;
}

.template-name {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbook.wb-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  color: var(--dark);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.workbook.wb-card:hover {
  border-color: var(--primary-main);
}

.wb-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #fff;
  border-bottom: 1px solid var(--grey-200);
  overflow: hidden;
}

.wb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.wb-icon {
  font-size: 34px;
  line-height: 1;
  color: var(--primary-main);
}

.wb-name {
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-meta {
  font-size: 12px;
  padding: 0 12px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-card-wrap {
  position: relative;
}

.wb-leave {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}

.wb-leave button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--grey-200);
  background: #fff;
  color: var(--grey-600);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.wb-leave button:hover {
  border-color: var(--error);
  color: var(--error);
}

.profile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  margin: 0;
}

.profile dt {
  font-weight: 600;
  color: var(--grey-600);
}

.profile dd {
  margin: 0;
}
