:root {
  --primary: #5C7389;
  --secondary: #2F3A47;
  --background: #F5F6F7;
  --text-dark: #4C4B4B;
  --accent-dark: #1C3D5A;
  --accent-green: #225E56;
  --accent-gold: #C9A148;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Lato", sans-serif;
  background-color: var(--background);
  color: var(--text-dark);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Header */
.header {
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-bottom: 4px solid var(--primary);
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.header__brand {
  display: flex;
  align-items: center;
}

.header__logo {
  height: 3rem;
  width: auto;
  margin-right: 1rem;
}

.header__divider {
  display: none;
  height: 2rem;
  width: 1px;
  background: var(--gray-300);
  margin: 0 1rem;
}

.header__title {
  display: none;
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gray-700);
}

.header__welcome {
  font-family: "Poppins", sans-serif;
  font-size: 0.875rem;
  color: var(--gray-500);
}

@media (min-width: 768px) {
  .header__divider,
  .header__title {
    display: block;
  }
}

/* Main */
.main {
  flex-grow: 1;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.section {
  margin-bottom: 3rem;
}

.section__header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
}

.section__header--primary {
  border-color: var(--primary);
}

.section__header--muted {
  border-color: var(--gray-300);
}

.section__title {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 1.875rem;
  color: var(--secondary);
}

.section__subtitle {
  margin: 0.5rem 0 0;
  color: var(--gray-600);
}

/* Grids */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--courses {
  grid-template-columns: 1fr;
}

.grid--depts {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid--courses {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--depts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid--courses {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid--depts {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Course cards */
.course-card {
  background: var(--white);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-top: 4px solid var(--primary);
  transition: box-shadow 0.2s ease;
}

.course-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.course-card__body {
  padding: 1.25rem;
  flex-grow: 1;
}

.course-card__title {
  margin: 0 0 0.5rem;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--secondary);
}

.course-card__desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card__footer {
  padding: 0.75rem 1.25rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 0.5rem 0.5rem;
}

.course-card__cta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.course-card__icon {
  width: 1rem;
  height: 1rem;
}

/* Department cards */
.dept-card {
  background: var(--white);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dept-card__header {
  padding: 0.75rem 1.25rem;
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dept-card__name {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
}

.dept-card__badge {
  background: var(--white);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-weight: 700;
}

.dept-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-grow: 1;
}

.dept-card__item {
  border-top: 1px solid var(--gray-100);
}

.dept-card__item:first-child {
  border-top: none;
}

.dept-card__btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gray-800);
  transition: background-color 0.2s ease;
}

.dept-card__btn:hover {
  background: var(--gray-50);
}

.dept-card__btn:hover .dept-card__course-title {
  font-weight: 600;
}

.dept-card__btn:hover .dept-card__arrow {
  color: var(--primary);
}

.dept-card__course-title {
  font-size: 0.875rem;
  transition: font-weight 0.2s ease;
}

.dept-card__arrow {
  width: 1rem;
  height: 1rem;
  color: var(--gray-400);
  flex-shrink: 0;
  margin-left: 0.75rem;
  transition: color 0.2s ease;
}

.dept-card__empty {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--gray-400);
  font-style: italic;
  text-align: center;
}

/* Footer */
.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  margin-top: auto;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  gap: 1rem;
}

.footer__copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.footer__logo {
  height: 1.5rem;
  width: auto;
  opacity: 0.5;
  filter: grayscale(100%);
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-family: "Poppins", sans-serif;
  color: var(--white);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
  border: none;
  cursor: pointer;
}

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

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

.btn--green {
  background: var(--accent-green);
}

.btn--green:hover {
  background: #1a4740;
}

.btn--disabled,
.btn--disabled:hover {
  background: var(--gray-400);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.85;
}

/* Modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal__dialog {
  position: relative;
  background: var(--white);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 32rem;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  z-index: 1;
}

.modal__header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--secondary);
  color: var(--white);
}

.modal__title {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.25;
  padding-right: 1rem;
}

.modal__close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.modal__close:hover {
  color: var(--gray-300);
}

.modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  color: var(--gray-700);
}

.modal__description {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
}

.modal__steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal__step {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
}

.modal__step-title {
  margin: 0 0 0.5rem;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
}

.modal__step-text {
  margin: 0 0 1rem;
  font-size: 0.875rem;
}

.modal__materials {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

body.modal-open {
  overflow: hidden;
}
