:root {
  --bg: #fff;
  --card: #fff;
  --muted: #6b7280;
}

:root {
  --icon-size: 18px;
  --icon-gap: 8px
}

* {
  box-sizing: border-box
}

body {
  font-family: Inter, system-ui, Segoe UI, Arial;
  background: linear-gradient(135deg, #fef3c7, #fce7f3 30%, #e0f2fe);
  min-height: 100vh;
  margin: 0;
  color: #111
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px
}

.site-header.small {
  padding: 12px 20px
}

.logo {
  font-family: Pacifico, cursive;
  font-size: 34px;
  display: flex;
  align-items: center;
  gap: 6px
}

.logo.small {
  font-size: 20px
}

.logo-part {
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #7ee8fa, #b388ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 4px 6px;
  border-radius: 6px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06)
}

.logo-homeworks {
  font-weight: 700;
  color: #0f172a;
  margin-left: 6px
}

.nav {
  display: flex;
  gap: 10px
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 600
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--icon-gap)
}

.btn-primary {
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  color: #fff;
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.18)
}

.btn-secondary {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  color: #fff
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px
}

.hero-card {
  max-width: 900px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), #ffffff);
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  text-align: center
}

.hero-title {
  font-size: 28px;
  margin: 6px 0
}

.hero-sub {
  color: var(--muted);
  margin-bottom: 16px
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center
}

.preview {
  padding: 20px
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px
}

.card {
  background: linear-gradient(180deg, #ffffff, #fbfbff);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.06);
  margin-bottom: 18px
}

.small .card {
  margin-top: 14px
}

.input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e6e7eb;
  margin-bottom: 8px
}

.textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e6e7eb
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px
}

.row {
  display: flex;
  gap: 12px
}

.actions {
  margin-top: 12px
}

.file-label {
  display: inline-block;
  padding: 10px 12px;
  background: linear-gradient(90deg, #ff9a9e, #fecfef);
  border-radius: 10px;
  color: #111;
  cursor: pointer
}

.img-preview {
  margin-top: 10px
}

.img-preview img {
  max-width: 220px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.08)
}

.homeworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px
}

.homework-card {
  background: linear-gradient(135deg, #fff, #f8fafc);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.04)
}

.homework-card h4 {
  margin: 0 0 6px 0
}

.homework-card .meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px
}

.homeworks-list {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.text-success {
  color: green
}

.text-error {
  color: #dc2626
}

.centered-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh
}

.card.small {
  width: 360px;
  text-align: center
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px
}

.site-footer {
  text-align: center;
  padding: 14px;
  color: var(--muted)
}

@media (min-width:800px) {
  .form-grid {
    grid-template-columns: 1fr 1fr
  }

  .form-grid textarea {
    grid-column: 1/-1
  }
}

/* Mobile-specific UI */
.logo-note {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0
}

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px
}

.mobile-header .logo {
  font-size: 20px
}

.mobile-bottom-nav {
  display: none
}

.btn .icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
  display: block
}

.btn svg {
  stroke: currentColor;
  fill: none;
  width: 100%;
  height: 100%
}

@media (max-width:799px) {

  /* hide the wide header buttons and show mobile header */
  .site-header .nav {
    display: none
  }

  .site-header {
    padding: 12px
  }

  .mobile-header {
    display: flex
  }

  .logo-homeworks {
    display: none
  }

  .logo-note {
    font-size: 12px
  }

  .hero {
    padding: 20px 12px
  }

  /* fixed bottom navigation for mobile */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 12px;
    justify-content: space-around;
    padding: 10px 20px;
    margin: 0 12px;
    background: linear-gradient(90deg, #ffffff, #fbfbff);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
    z-index: 50
  }

  .mobile-bottom-nav .btn {
    padding: 10px 14px;
    border-radius: 10px
  }

  /* slightly larger icons on mobile nav */
  .mobile-bottom-nav .btn {
    --icon-size: 20px
  }

  /* increase gap on touch targets */
  .mobile-bottom-nav .btn {
    gap: 10px
  }
}

/* Responsive icon sizing: default uses --icon-size but clamp keeps it reasonable */
:root {
  --icon-size: clamp(16px, 2.2vw, 22px)
}