:root {
  --font-family: 'Poppins', sans-serif;

  --h1-size: 56px;
  --h2-size: 40px;
  --h3-size: 32px;
  --h4-size: 28px;
  --s1-size: 24px;
  --s2-size: 20px;
  --text-size: 20px;
  --caption-1: 12px;
  --caption-2: 12px;
  --caption-3: 10px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@600&display=swap');
:root {
  --font-family: 'Poppins', sans-serif;

  --h1-size: 56px;
  --h2-size: 40px;
  --h3-size: 32px;
  --h4-size: 28px;
  --s1-size: 24px;
  --s2-size: 20px;
  --text-size: 20px;
  --caption-1: 12px;
  --caption-2: 12px;
  --caption-3: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-size);
  line-height: 28px;
  font-weight: 400;
  background-color: transparent;
  min-height: 100vh;
  background: #2F832F80;
  position: relative;
}


/* Headings */
.h1 {
  font-size: var(--h1-size);
  font-weight: 600;
  line-height: 68px;
}

.h2 {
  font-size: var(--h2-size);
  font-weight: 600;
  line-height: 48px;
}

.h3 {
  font-size: var(--h3-size);
  font-weight: 600;
  line-height: 38px;
}

.h4 {
  font-size: var(--h4-size);
  font-weight: 600;
  line-height: 34px;
}

/* Subtitles */
.s1 {
  font-size: var(--s1-size);
  font-weight: 500;
  line-height: 22px;
  color: #414141;
}

.s2 {
  font-size: var(--s2-size);
  font-weight: 600;
  line-height: 28px;
}

/* Text */
.text-bold {
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.text-medium {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}

.text-regular {
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
}

/* Captions */
.caption-1 {
  font-size: var(--caption-1);
  font-weight: 400;
  line-height: 16px;
}

.caption-2 {
  font-size: var(--caption-2);
  font-weight: 500;
  line-height: 16px;
}

.caption-3 {
  font-size: var(--caption-3);
  font-weight: 500;
  line-height: 14px;
}

/* Layout */
header {
  background-color: #275D2B;
  height: 80px;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  width: 156.48px;
  height: 48px;
  object-fit: contain;
  margin-left: 110px;
}

.language-select {
  color: white;
  font-size: 16px;
  margin-right: 40px;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 100px;
}


#mainContent {
  position: relative;
  z-index: 1;
  padding-left: 0;
  /* no offset from sidebar */
}



.login-card {
  background-color: #FFFFF9;
  width: 656px;
  height: 724px;
  border-radius: 24px;
  padding: 100px;
  box-shadow:
    -5px 0 5px #2F832F,
    5px 0 5px #2F832F;
  margin-top: 100px;
}

/* Восстановление: та же карточка, но тянется по содержимому */
.recovery-card {
  background-color: #FFFFF9;
  width: 656px;
  min-height: 480px;  /* базовый размер, дальше растёт сама */
  height: auto;       /* ключевое отличие от .login-card */
  border-radius: 24px;
  padding: 100px;
  box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
  margin-top: 100px;
}

/* Inputs with icons */
.input-wrapper {
  position: relative;
  margin-top: 8px;
}

/* vertical divider between left icon and input text */
.input-wrapper::after {
  content: "";
  position: absolute;
  left: 40px;               /* aligns with left icon padding */
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 22px;             /* inside a 44px tall input */
  background: #D9D9D9;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1em;
  font-family: var(--font-family);
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  cursor: pointer;
  opacity: 0.7;
}

.actions {
  text-align: right;
  margin-top: 5px;
}

.actions a {
  font-size: 16px;
  font-weight: 500;
  color: #275D2B;
  text-decoration: none;
}

.login-card button,
.recovery-card button,
.registration-card button {
  width: 100%;
  background-color: #E37009;
  color: white;
  padding: 14px;
  border: none;
  border-radius: 8px;
  margin-top: 25px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 500;
}

/* Apply page: compact action button inside request rows */
.apply-form .btn-more {
  width: auto;
  height: 32px;
  padding: 0 16px;
  border-radius: 24px;
  background: #275D2B;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  line-height: 32px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.register {
  text-align: center;
  margin-top: 20px;
  font-size: 20px;
  font-weight: 400;
}

.register a {
  color: #E37009;
  text-decoration: none;
  padding-left: 20px;
  font-size: 20px;
  font-weight: 500;
}

/* ========== Registration Page Card Layout ========== */


.registration-card {
  background-color: #FFFFF9;
  width: 1140px;
  min-height: 1000px;
  border-radius: 24px;
  padding: 60px 100px;
  margin-top: 140px;
  box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
}

/* Two-column layout */
.form-section {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  align-items: flex-start;
}

.form-left {
  flex: 1;
}

.form-right img {
  width: 300px;
  height: auto;
  object-fit: contain;
  align-self: flex-start;   /* align image with the top of name fields */
  display: block;
  margin-top: 0;
}

/* Form Groups */
.form-group {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  padding-bottom: 15px;
}


.bottom-row {
  display: block;
}

.bottom-row textarea {
  width: 940px;
  height: 105px;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #ccc;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.13);
  resize: vertical;
}

.registration-card input[type="text"],
.registration-card input[type="email"],
.registration-card input[type="tel"],
.registration-card textarea {
  width: 456px;
  height: 32px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
}

/* Radio Buttons */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.radio-group label {
  font-size: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.radio-group input[type="radio"] {
  accent-color: #E37009;
  margin-right: 8px;
  width: 18px;
  height: 18px;
}


.bottom-row textarea {
  width: 940px;
  height: 105px;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #ccc;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.13);
  resize: vertical;
}

.phone-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.country-code-select {
  height: 40px;
  padding: 0 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #fff;
}



.checkbox-section {
  margin-top: 60px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.checkbox-group label {
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: center;
}

.checkbox-group input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #E37009;
  border-radius: 4px;
  margin-right: 10px;
  cursor: pointer;
  position: relative;
}

.checkbox-group input[type="checkbox"]:checked {
  background-color: #E37009;
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-group input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.toggle-btn {
  margin-top: 20px;
  background-color: #D97A1C;
  color: white;
  border: none;
  padding: 10px 28px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  border-radius: 30px;
  cursor: pointer;
}


.toggle-btn {
  background-color: #E37009;
  color: white;
  border: none;
  padding: 6px 20px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  border-radius: 24px;
  cursor: pointer;
  height: 32px;
  width: fit-content;
  /* prevents full width */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}



.save-btn {
  background-color: #275D2B;
  color: white;
  border: none;
  padding: 10px 53px;
  font-size: 18px;
  font-family: 'Poppins', sans-serif;
  border-radius: 24px;
  cursor: pointer;
  width: 196px;
  height: 48px;
}



.about-me-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 64px;
  line-height: 76px;
  text-align: center;
  letter-spacing: 0;
  color: #ffffff;
  /* or dark if needed */
  padding-bottom: 100px;
}


.background-top {
  position: absolute;
  /* ← makes it scroll with content */
  top: 0;
  left: 0;
  height: 600px;
  width: 100%;
  background: url('assets/pr-back.png') no-repeat center top;
  background-size: cover;
  background-color: #E4EFE2;
  /* soft green fallback */
  z-index: -1;
}




.profile-background {
  position: relative;
  z-index: 1;
}


/* Registration Success (desktop defaults) */
body.success-page header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #275D2B;
}
body.success-page {
  padding-top: 80px; /* reserve space for fixed header */
}
.success-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 24px 16px;
  background-color: #96C194;
}
.success-image {
  display: block;
  width: 100%;
  max-width: 820px;
  height: auto;
  object-fit: contain;
}

/* Success page navbar tweaks */
body.success-page .nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
}
body.success-page .nav-btn {
  border-radius: 24px;
  padding: 10px 20px;
  background-color: #ECF5EB;
  color: #275D2B;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-width: clamp(140px, 28vw, 196px);
  text-align: center;
}
body.success-page .nav-btn:hover {
  background-color: #d9ebd7;
  color: #275D2B;
}



/*Sidebar*/
.sidebar {
  position: fixed;
  /* instead of absolute */
  left: 0;
  top: 0;
  z-index: 100;
  /* make sure it's above content */
  height: 100vh;
  background-color: #ECF5EB;
  padding: 24px;
  gap: 24px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;           
  overflow-x: hidden;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  /* optional shadow */
}


.sidebar.expanded {
  width: 256px;
  align-items: flex-start;
}

.sidebar.collapsed {
  width: 92px;
  align-items: center;
}

.sidebar .toggle-button {
  position: absolute;
  top: 32px;
  right: -12px;
  /* this makes it "stick out" from the sidebar */
  width: 32px;
  height: 32px;
  background: #f3f8f1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  /* make sure it's above other elements */
  transition: right 0.3s ease;
}


.sidebar nav a.active {
  background-color: #FFFFFF;
    flex: 1 1 auto;
}



.sidebar nav a span {
  transition: opacity 0.3s ease, max-width 0.3s ease, margin 0.3s ease;
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  opacity: 1;
  max-width: 200px;
  margin-left: 10px;
}

.sidebar.collapsed nav a span {
  opacity: 0;
  max-width: 0;
  margin-left: 0;
}


.sidebar.collapsed nav a .tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background-color: #2D5C2D;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
  margin-left: 8px;
  z-index: 9999;
}

.sidebar.collapsed nav a:hover .tooltip {
  opacity: 1;
}


.sidebar .toggle-button img {
  width: 20px;
  height: 20px;
  transition: transform 0.5s ease;
}


.sidebar .logo,
.sidebar .profile,
.sidebar nav,
.sidebar .logout {
  margin-bottom: 20px;
}

.sidebar .profile {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FFFFFF20;
}

.sidebar .logo {
  width: 160px;
  /* Fix width so it doesn’t overflow */
  height: auto;
  object-fit: contain;
  display: block;
  margin-left: 12px;
  /* Add some spacing inside the sidebar */
}

.sidebar .logo-collapsed {
  width: 40px;
  height: auto;
  object-fit: contain;
  display: none;
}

.sidebar.collapsed .logo {
  display: none;
}

.sidebar.collapsed .logo-collapsed {
  display: block;
  margin-left: 0;
  /* optional if you want it centered */
}



.sidebar .line {
  border-radius: 2px;
  height: 2px;
  margin: 12px 0;
}

.sidebar.expanded .line {
  width: 208px;
}

.sidebar.collapsed .line {
  width: 44px;
}




.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border-radius: 8px;
  color: #333;
  text-decoration: none;
  margin-bottom: 12px;
  position: relative;
}


.sidebar.collapsed nav a span {
  display: none;
}

.sidebar .logout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  color: #E04343;
  font-weight: 500;
  cursor: pointer;
  font-size: 16px;
  position: sticky;
  bottom: 12px;                /* прилипает к низу при скролле */
  background: #ECF5EB;         /* фон как у сайдбара, чтобы не мигал */
  padding: 8px 10px;
  border-radius: 10px;
  z-index: 1; 
}

.sidebar.collapsed .logout span {
  display: none;
   justify-content: center;   
}


.view-site-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  background: #0f77ff;
  color: #fff;
  cursor: pointer;
}
.view-site-button:hover { opacity: 0.9; }

/* ========== Profile Layout ========== */
.profile-container {
  max-width: 1110px;
  margin: 0 auto;
  padding: 60px 20px;
}

.profile-hero {
  padding-top: 600px;
  /* push it down */
  text-align: center;
}


.progress-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  margin-bottom: 40px;
}

.step {
  width: 76px;
  height: 76px;
  border: 2px solid #275D2B;
  border-radius: 50%;
  font-size: 32px;
  font-weight: 600;
  color: #275D2B;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.step.active {
  background-color: #275D2B;
  color: #fff;
}


.step:hover {
  background-color: #e4efe2;
}


.profile-card-wrapper {
  margin-top: 80px;
  /* more space after hero */
  display: flex;
  justify-content: center;
  padding-bottom: 100px;
}

.profile-top {
  text-align: center;
}

.profile-illustration {
  width: 220px;
  margin-bottom: 20px;
}

.progress-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  /* spacing between step and line */
  margin-bottom: 40px;
}

.step {
  width: 76px;
  height: 76px;
  border: 2px solid #275D2B;
  border-radius: 50%;
  background-color: transparent;
  color: #275D2B;
  font-size: 32px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.step.active {
  background-color: #275D2B;
  color: #fff;
}

.step-line {
  width: 92px;
  height: 2px;
  background-color: #275D2B;
}



#step1 .profile-card {
  width: 1110px;
  border-radius: 24px;
  padding: 80px 100px;
  background-color: #FFFFF9;
  box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
}


.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-label {
  font-weight: 500;
  color: #555;
  min-width: 120px;
}


.profile-value-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}


.profile-value {
  font-weight: 500;
  color: #000;
}

.edit-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.edit-icon:hover {
  opacity: 1;
}



/* Step 2 Card Styling */
#step2 .profile-card {
  width: 1110px;
  min-height: 1400px;
  border-radius: 24px;
  padding: 80px 100px;
  background-color: #FFFFF9;
  box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#step2 p {
  font-size: 20px;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

#step2 span,
#step3 span {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  margin-top: 8px;
}

#step2 .edit-icon {
  width: 18px;
  height: 18px;
  margin-left: 12px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

#step2 .edit-icon:hover {
  opacity: 1;
}

.textarea-wrapper {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.edit-textarea {
  width: 910px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 8px 12px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  resize: vertical;
  transition: all 0.3s ease;
}

.check-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin-top: 6px;
  opacity: 0.8;
}

.check-icon:hover {
  opacity: 1;
}



.edit-input {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 12px 16px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  border: 1px solid #ccc;
  border-radius: 8px;
  line-height: 1.4;
  box-sizing: border-box;
}

.profile-photo-wrapper {
  position: relative;
  width: 208px;
  height: 226px;
  margin: 0 auto;
  border-radius: 16px;
  padding: 10px;
}

.profile-photo {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.photo-upload-icon {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #D9781C;
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}

.profile-info p {
  font-size: 20px;
  margin-bottom: 20px;
  font-family: 'Poppins', sans-serif;
}


.edit-icon {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.6;
  vertical-align: middle;
  transition: opacity 0.2s ease;
}

.edit-icon:hover {
  opacity: 1;
}



.editable-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.editable-field .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editable-field label {
  font-size: 16px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
}

.editable-field input {
  width: 940px;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
}

.editable-field .edit-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.editable-field .edit-icon:hover {
  opacity: 1;
}



.rating-stars {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.rating-stars .star {
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.rating-stars .star:hover {
  transform: scale(1.1);
}


/* Step 3 Card Styling */
#step3 .profile-card {
  width: 1110px;
  min-height: 1600px;
  border-radius: 24px;
  padding: 80px 100px;
  background-color: #FFFFF9;
  box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

#step3 .editable-field {
  background-color: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#step3 .editable-field label {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
  display: block;
  color: #275D2B;
}

#step3 p {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
}


#step3 .edit-icon {
  width: 18px;
  height: 18px;
  margin-left: 12px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

#step3 .edit-icon:hover {
  opacity: 1;
}

.profile-step span {
  white-space: pre-wrap;
  word-break: break-word;
  display: block;
  margin-top: 8px;
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 2px solid #E37009;
  border-radius: 8px;
  overflow: hidden;
}

.custom-table td {
  border: 2px solid #E37009;
  padding: 10px;
  font-size: 16px;
  vertical-align: middle;
  width: 50%;
}





/* ========== Library Layout ========== */


.library-background-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 600px;
  background: url('assets/library/library-back.png') no-repeat top center;
  background-size: cover;
  z-index: -1;
}



.library-hero {
  width: 100%;
  max-width: 1110px;
  margin: 80px auto 60px;
  text-align: center;
  position: relative;
}

.library-background {
  position: relative;
  z-index: 1;
}

.hero-img {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  /* optional spacing */
}


.hero-title {
  font-size: 64px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  padding: 20px;
}


.library-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.library-card {
  width: 1110px;
  height: 212px;
  background-color: #fffef9;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.library-card .info {
  width: 428px;
  height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}



.library-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #2D2D2D;
  font-family: 'Poppins', sans-serif;
}

.library-card .info p {
  font-size: 14px;
  color: #2D2D2D;
  opacity: 0.8;
  font-family: 'Poppins', sans-serif;
  line-height: 22px;
  margin: 0;
  word-break: break-word;
  max-width: 428px;
  max-height: 66px;
  overflow: hidden;
}



.library-card .image {
  height: 140px;
}

.library-card .arrow {
  width: 64px;
  height: 64px;
}


/* ========== Main Library Layout ========== */

.main-header {
  width: 1110px;
  height: 212px;
  margin: 160px auto 28px;
  padding: 0 40px;
  border-radius: 24px;
  background-color: #FFFFF9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.main-header h2 {
  font-size: 36px;
  font-weight: 700;
  color: #333;
  padding-left: 100px;
}

.main-header img {
  height: 120px;
  padding-right: 100px;
}

.nav-buttons {
  width: 1110px;
  margin: 0 auto 28px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.nav-buttons a {
  text-decoration: none;
  /* remove link underline */
}

.nav-button {
  width: 296px;
  height: 48px;
  border-radius: 24px;
  padding: 10px 53px;
  background-color: #275D2B;
  /* Default */
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Hover */
.nav-button:hover {
  background-color: #2F8B35;
}

/* Focus */
.nav-button:focus {
  background-color: #275D2B;
  outline: none;
}

/* Pressed */
.nav-button:active {
  background-color: #3BBA44;
}

.nav-button.secondary {
  background-color: #3C6E44;
}

/* Optional: Add hover/active for secondary too if needed */
.nav-button.secondary:hover {
  background-color: #2F8B35;
}

.nav-button.secondary:active {
  background-color: #3BBA44;
}

.edit-textarea[readonly],
.edit-textarea.locked {
  background: #f5f5f5;
  color: #666;
  cursor: not-allowed;
}


.library-content {
  width: 1110px;
  height: auto;
  margin: 28px auto;
  padding: 10px 100px;
  border-radius: 24px;
  background-color: #FFFDF6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tabs {
  display: flex;
  border-bottom: 3px solid #F1E1C0;
  margin-bottom: 28px;
}

.tab {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 16px;
  color: #999;
  cursor: pointer;
}

.tab.active {
  color: #1a1a1a;
  border-bottom: 3px solid #E37009;
}

.date-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  position: relative;
  width: 100%;
  max-width: 1110px;
}

.date-label {
  font-weight: 600;
  font-size: 16px;
  color: #333;
  text-align: left;
}

.date-inputs {
  display: flex;
  gap: 12px;
}

.date-input {
  width: 236px;
  height: 48px;
  border: 1px solid #E37009;
  border-radius: 8px;
  padding: 0 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

.filter-btn-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.filter-btn {
  width: 113px;
  height: 32px;
  padding: 0 20px;
  border: 1px solid #CFCFCF;
  border-radius: 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  color: white;
  cursor: pointer;
  background-color: #E37009;
  transition: background-color 0.2s ease;
}

.filter-btn:hover:not(:disabled) {
  background-color: #B65600;
}

.filter-btn:focus:not(:disabled) {
  background-color: #E37009;
  outline: none;
}

.filter-btn:active:not(:disabled) {
  background-color: #9F4B00;
}

.filter-btn:disabled {
  background-color: #F3F2F1;
  color: white;
  cursor: not-allowed;
}



.video-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  text-align: left;

}

.video-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.video-item p {
  font-size: 13px;
  color: #333;
  opacity: 0.8;
  margin-bottom: 12px;
}

.video-thumb {
  width: 516px;
  height: 316px;
  background: #CFCFCF;
  border-radius: 8px;
}


.book-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  text-align: left;
}

.book-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fffdf6;
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  font-family: 'Poppins', sans-serif;
}

.book-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.book-info p {
  font-size: 13px;
  color: #333;
  opacity: 0.8;
  margin-bottom: 0;
}

.book-download-btn {
  background-color: #295F2D;
  color: white;
  padding: 10px 24px;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.book-download-btn:hover {
  background-color: #1e4821;
}





.materials-library-content {
  width: 1110px;
  height: auto;
  background-color: #FFFDF6;
  border-radius: 24px;
  padding: 60px 100px;
  margin: 28px auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Date Picker Section */
.date-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.date-label {
  font-weight: 600;
  font-size: 16px;
  color: #333;
  text-align: left;
}

.date-inputs {
  display: flex;
  gap: 12px;
}

.date-input {
  width: 236px;
  height: 48px;
  border: 1px solid #E37009;
  border-radius: 8px;
  padding: 0 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #333;
}

.filter-btn-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.filter-btn {
  width: 116px;
  height: 32px;
  padding: 0 20px;
  border: 1px solid #CFCFCF;
  border-radius: 24px;
  background-color: #F4F4F4;
  color: #aaa;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
}




/* Course Material Layout */
.course-item {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 60px;
}

.course-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #2D2D2D;
}


/* Матеріали до лекції */
.lecture-materials-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-btn {
  width: 116px;
  height: 32px;
  border-radius: 24px;
  background-color: #275D2B;
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}


.week-block {
  margin-bottom: 20px;
}

.accordion-toggle {
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
  background-color: #F5E2CC;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.accordion-toggle:hover {
  background-color: #efd4b3;
}

.accordion-content {
  display: none;
  background: #fff;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  box-shadow: inset 0 1px 0 #ddd;
  margin-top: -8px;
}

.lecture-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}



/* ========== My Courses Layout ========== */


.my-courses-section {
  padding-top: 160px;
  /* or more, if you need to push it down */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  /* space between each card */
}


.my-courses-hero {
  text-align: center;
  margin-bottom: 32px;
}

.my-courses-hero-img {
  width: 398px;
  max-width: none;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  /* optional spacing */
}

.my-courses-title {
  font-size: 64px;
  font-weight: 600;
  color: white;
  padding: 100px;
}

.course-card {
  width: 1110px;
  height: 212px;
  background-color: #fffef9;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  gap: 28px;
}


.course-info h3 {
  font-size: 40px;
  font-weight: 600;
  color: #2D2D2D;
  font-family: 'Poppins', sans-serif;
}

.course-illustration {
  height: 164px;
  width: 284px;
}


.arrow-btn {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


.arrow-btn:hover {
  transform: scale(1.1);
}

.arrow {
  width: 64px;
  height: 64px;
}

/* Make the outer certificate block expand */
.certificate-block {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin-bottom: 40px;
}

/* Allow the viewer to stretch */
.certificate-image-switcher {
  width: 100%;
  max-width: none;
  margin-top: 24px;
}

/* Force embed to fill parent */
.certificate-display {
  display: block;
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 12px;
}

.current-course-description {
  font-size: 15px;
  color: #555;
  margin-top: 4px;
}

.certificate-placeholder {
  text-align: center;
  font-size: 16px;
  color: #999;
  font-style: italic;
  padding: 40px 0;
  border: 1px dashed #ccc;
  border-radius: 12px;
}


.certificate-card {
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-bottom: 36px;
  font-family: Poppins;
}

.date-line {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  color: #275D2B;
  gap: 12px;
  margin-bottom: 16px;
}

.date-line hr {
  flex: 1;
  border: none;
  border-top: 1px solid #275D2B;
}

.certificate-preview {
  text-align: center;
  margin-bottom: 16px;
}

.certificate-embed {
  width: 100%;
  height: 500px;
  border: 1px solid #ccc;
  border-radius: 12px;
}

.card-body {
  margin-bottom: 16px;
}

.certificate-title {
  font-size: 18px;
  font-weight: 600;
  color: #1E1E1E;
  margin-bottom: 4px;
}

.certificate-description {
  font-size: 15px;
  color: #414141;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.lang-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #275D2B;
}

input:checked+.slider:before {
  transform: translateX(20px);
}

.lang-labels {
  font-size: 14px;
  color: #06142E;
  font-weight: 500;
}

.view-button {
  width: 110px;
  height: 24px;
  font-size: 14px;
  font-weight: 500;
  background-color: #275D2B;
  color: white;
  border: none;
  border-radius: 12px;
  line-height: 24px;
  padding: 0;
  cursor: pointer;
  text-align: center;
}




.modal-course-dates {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  color: #275D2B;
  text-align: center;
  margin-bottom: 32px;
}

.modal-course-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 32px;
  color: #414141;
  margin-bottom: 24px;
}

.modal-course-subtitle {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #606060;
  margin-bottom: 24px;
}

.modal-course-description {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #414141;
  text-align: justify;
  margin-bottom: 36px;
}

.modal-course-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-course-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #8F8F8F;
}

.modal-course-answer {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: #414141;
}

.modal-current-course {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-course-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.view-site-button {
  background-color: #275D2B;
  color: white;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 24px;
  width: 160px;
  height: 32px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
  line-height: 32px;
  padding: 0;
  /* убрать внутренний отступ */
}


.view-site-button:hover {
  background-color: #1e4622;
}


.modal-current-course-content {
  background: #fff;
  width: 1110px;
  height: auto;
  border-radius: 24px;
  padding: 60px 100px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}


.modal-current-course-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 32px;
  cursor: pointer;
}

/* Completed Courses Content */
.completed-courses-content {
  width: 1110px;
  height: auto;
  margin: 60px auto;
  padding: 60px 100px;
  border-radius: 24px;
  background-color: #FFFDF6;
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Navigation Button Container */
.completed-nav-buttons {
  display: flex;
  gap: 50px;
  margin-top: 30px;
  margin-bottom: 28px;
  justify-content: flex-start;

}

.completed-nav-button.create {
  background-color: #E37009;
  /* Green */
}

/* Base Navigation Button Style */
.completed-nav-button {
  width: 196px;
  height: 48px;
  border-radius: 24px;
  background-color: #275D2B;
  /* Default */
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  gap: 10px;
}

/* Hover */
.completed-nav-button:hover {
  background-color: #2F8B35;
}

/* Focus */
.completed-nav-button:focus {
  background-color: #275D2B;
  outline: none;
}

/* Pressed (active) */
.completed-nav-button.active {
  background-color: #3BBA44 !important;
}

.completed-nav-button.secondary {
  background-color: #275D2B;
}


.current-course-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.course-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.join-meeting-btn,
.current-show-more-btn {
  width: auto;
  font-family: 'Poppins', sans-serif;
  padding: 10px 20px;
  border-radius: 24px;
  height: 32px;
  font-size: 12px;
  text-decoration: none;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}


.join-meeting-btn {
  background-color: #275D2B;
}

.current-show-more-btn {
  background-color: #295F2D;
}


.certificate-block {
  width: 100%;
  max-width: 910px;
  margin: 0 auto;
}


.modal-course-dates-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 36px;
}

.modal-course-dates-line hr {
  flex: 1;
  height: 1px;
  border: none;
  background-color: #275D2B;
  opacity: 1;
}

.modal-course-dates-line span {
  font-family: Poppins, sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  color: #275D2B;
  text-align: center;
}


.course-date-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.course-date-line hr {
  flex-grow: 1;
  height: 1px;
  border: none;
  background-color: #275D2B;
  opacity: 1;
}

.course-date-line span {
  font-family: Poppins, sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  color: #275D2B;
  text-align: center;
}

.course-entry {
  background-color: #fffdf6;
  border-radius: 16px;
  padding: 40px 60px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 1110px;
  margin: 0 auto 40px;
  font-family: 'Poppins', sans-serif;
}

.course-date {
  display: block;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #295F2D;
  margin-bottom: 20px;
  border-top: 1px solid #295F2D;
  padding: 10px 0;
}




.course-details-btn {
  width: 136px;
  display: inline-block;
  background-color: #295F2D;
  color: white;
  padding: 10px 24px;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.course-details-btn:hover {
  background-color: #1e4821;
}


.certificate-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* text stays left */
  gap: 16px;
}

.certificate-img {
  display: block;
  margin: 0 auto;
  /* image centers */
  max-width: 100%;
  height: auto;
}


.certificate-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.certificate-links a {
  color: #1E48C1;
  font-weight: 600;
  text-decoration: none;
}

.certificate-dates {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 910px;
  margin: 0 auto 32px;
  color: #275D2B;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
}

.certificate-dates::before,
.certificate-dates::after {
  content: "";
  flex: 1;
  height: 2px;
  background-color: #275D2B;
}

.certificate-dates::before {
  margin-right: 16px;
}

.certificate-dates::after {
  margin-left: 16px;
}

.course-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 32px;
  color: #414141;
  margin: 8px 0;
}

.course-subtitle {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #606060;
  margin: 6px 0;
}

.course-description {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  text-align: justify;
  color: #414141;
  vertical-align: middle;
  margin: 12px 0;
}



.current-course-item {
  position: relative;
  padding-bottom: 80px;
  /* gives space for button */
}

.current-course-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
  /* выравнивание кнопок по низу */
}


/* Title and subtitle styling */
.current-course-title {
  font-size: 28px;
  font-weight: 700;
  color: #2D2D2D;
  margin-bottom: 12px;
}

.current-course-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: #444;
  opacity: 0.9;
  max-width: 80%;
}


.current-show-more-btn:hover {
  background-color: #1e4821;
}


.modal {
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 12px;
  width: 400px;
}

.modal-content input {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
}

.modal-content button {
  width: 100%;
  padding: 10px;
}

.tag {
  background-color: #f0f0f0;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}


.create-course-content {
  width: 1110px;
  background-color: #fffef9;
  margin: 28px auto;
  padding: 60px 100px;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.create-course-content .form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.create-course-content input,
.create-course-content select,
.create-course-content textarea {
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  resize: vertical;
}

.create-course-content textarea {
  min-height: 100px;
  line-height: 1.5;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 8px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.save-btn-wrapper {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.save-btn {
  background-color: #275D2B;
  color: white;
  border: none;
  padding: 10px 53px;
  font-size: 18px;
  font-family: 'Poppins', sans-serif;
  border-radius: 24px;
  cursor: pointer;
  width: auto;
  height: 48px;
}

.date-range,
.time-range {
  display: flex;
  gap: 16px;
  align-items: center;
}

.date-range input[type="date"],
.time-range input[type="time"] {
  padding: 12px;
  border: 1px solid #E37009;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  width: 200px;
  background-color: #fffef9;
  color: #333;
}

.weekdays-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.weekdays-checkboxes label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #2D2D2D;
}

.weekdays-checkboxes input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #E37009;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.weekdays-checkboxes input[type="checkbox"]:checked {
  background-color: #E37009;
}

.weekdays-checkboxes input[type="checkbox"]:checked::after {
  content: "✔";
  color: white;
  font-size: 14px;
  position: absolute;
  left: 4px;
  top: -1px;
}


.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.checkbox-tile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-square {
  width: 20px;
  height: 20px;
  border: 2px solid #E37009;
  border-radius: 4px;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.checkbox-square.checked {
  background-color: #E37009;
}

.checkbox-square::after {
  content: '✔';
  font-size: 14px;
  color: white;
  display: none;
}

.checkbox-square.checked::after {
  display: block;
}

.checkbox-tile span {
  font-size: 14px;
}



.cert-page {
  padding: 60px 40px;
}

.cert-nav {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.cert-btn {
  background: #3C6E44;
  color: #fff;
  padding: 12px 24px;
  border-radius: 32px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.cert-btn:hover {
  background: #2F8B35;
}

.cert-btn.active {
  background: #275D2B;
}

.cert-btn.back {
  background: #1e4821;
}

.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
}

.cert-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  width: 500px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cert-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 16px;
}

.cert-title {
  font-size: 18px;
  font-weight: 600;
  color: #2D2D2D;
  margin: 8px 0;
  text-align: center;
}

.cert-dates {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.cert-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #E37009;
}

input:checked+.slider:before {
  transform: translateX(16px);
}

.view-btn {
  background: #E37009;
  color: #fff;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.view-btn:hover {
  background: #cf5d00;
}

.sidebar.expanded nav a:nth-child(3) span {
  white-space: normal;
  /* allow wrapping */
  max-width: 150px;
  /* force two lines */
  line-height: 1.1;
  /* tighter line spacing */
  text-align: left;
  /* nicer alignment */
}


/* ==== MODAL (детали заявки) ==== */
.req-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.req-modal {
  width: 720px;
  max-width: 90vw;
  background: #fff;
  border-radius: 16px;
  padding: 24px 24px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}

.req-modal h3 {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 600;
  color: #414141;
}

.req-meta {
  color: #6b6b6b;
  font-size: 14px;
  margin-bottom: 12px
}

.req-qa {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px
}

.req-qa .row {
  background: #FFF7EE;
  border-radius: 12px;
  padding: 12px 14px;
}

.req-qa .q {
  font-weight: 600;
  color: #275D2B;
  margin-bottom: 4px
}

.req-qa .a {
  white-space: pre-wrap;
  color: #414141
}

.req-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px
}

.req-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600
}

.req-btn.close {
  background: #f3f4f6
}

.req-btn.primary {
  background: #275D2B;
  color: #fff
}

/* маленькая иконка закрытия, если захочешь */
.req-close-x {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: .6;
}

.req-close-x:hover {
  opacity: 1
}

.site-header { display: none; }


/* =========================================
   AUTH PAGES (Login / Recovery / Credentials)
   Mobile adaptations + page-only background
   ========================================= */

/* Show the special background ONLY on pages that contain the .login-card
   (login.html, recovery.html, create-credentials.html).
   You can also force it by adding class="auth-bg" on &lt;body&gt; in those pages. */
body.auth-bg,
body:has(.login-card),
body:has(.recovery-card) {
  background: #F6F6F6 url('assets/background.png') no-repeat center top / cover;
}

/* Tablet tweaks (optional, keeps big cards but trims spacing) */
@media (max-width: 768px) {
  header {
    height: 72px;
    padding: 12px 20px;
  }
  .logo {
    margin-left: 0;
  }
  main {
    padding: 0 16px 60px;
  }
  .recovery-card,
  .login-card {
    width: 100%;
    max-width: 540px;
    height: auto;
    padding: 30px 30px 56px;
    margin-top: 48px;
    border-radius: 20px;
  }
  /* Success page @768 */
  body.success-page .nav-btn {
    font-size: 14px;
    padding: 10px 16px;
    min-width: 140px;
  }
}

/* Phone layout — matches the provided mobile spec:
   nav: 376x64
   container: 344 width, radius 16, padding 80/60/80/60
*/
@media (max-width: 480px) {
  /* NAV / HEADER */
  header {
    height: 64px;
    padding: 8px 16px;
  }
  .logo {
    width: 156px;
    height: 40px;
    object-fit: contain;
    margin-left: 0;
  }
  .language-select {
    font-size: 14px;
    margin-right: 0;
  }

  /* PAGE WRAPPER */
  main {
    padding: 0 16px 60px;
    align-items: center;
  }

  /* CARD */
  .recovery-card,
  .login-card {
    width: 344px;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    padding-top: 80px;
    padding-right: 16px;
    padding-bottom: 80px;
    padding-left: 16px;
    margin-top: 32px;
    box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
  }

  /* TYPOGRAPHY */
  .h1 {
    font-size: 28px;
    line-height: 34px;
    text-align: center;
  }
  .s1 {
    font-size: 16px;
    line-height: 24px;
  }
  .text-regular,
  .text-medium {
    font-size: 16px;
    line-height: 24px;
  }

  /* INPUTS */
  .input-wrapper {
    margin-top: 6px;
  }
  .input-wrapper input {
    width: 100%;
    height: 44px;
    padding: 10px 40px 10px 44px;
    font-size: 16px;
  }
  .input-icon {
    width: 18px;
    height: 18px;
  }
  .toggle-password {
    width: 20px;
    height: 20px;
  }

  /* LINKS + ACTIONS */
  .actions {
    text-align: right;
    margin-top: 8px;
  }
  .actions a {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 12px;
    text-align: right;
    display: block;
  }

  /* BUTTONS */
  .login-card button,
  .registration-card button {
    width: 100%;
    height: 48px;
    font-size: 18px;
    padding: 12px;
    margin-top: 18px;
    border-radius: 12px;
  }

  .register {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #414141;
    margin-top: 16px;
    display: flex;           /* force one line with the link */
    gap: 6px;
    justify-content: center; /* centered inside card */
    white-space: nowrap;     /* prevent wrapping */
  }
  .register a {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #E37009;
    text-decoration: none;
  }

  /* ===============================
     Credentials page (create-credentials.html)
     Mobile adaptation
     =============================== */
  .credentials-page header {
    height: 64px;
    padding: 8px 16px;
  }

  .credentials-page main {
    padding: 0 16px 60px;
    align-items: center;
  }

  .credentials-page .login-card {
    width: 344px;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    padding-top: 32px;   /* more compact than login */
    padding-right: 16px;
    padding-bottom: 32px;
    padding-left: 16px;
    margin-top: 24px;
    box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
  }

  .credentials-page .h1 {
    font-size: 28px;
    line-height: 34px;
    font-weight: 700;
    text-align: center;
  }

  .credentials-page .s1 {
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
  }

  .credentials-page .text-regular {
    font-size: 16px;
    line-height: 24px;
    text-align: center;
  }

  .credentials-page .hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
  }

  .credentials-page .input-wrapper {
    margin-top: 6px;
  }

  .credentials-page .input-wrapper input {
    width: 100%;
    height: 44px;
    padding: 10px 40px 10px 44px;
    font-size: 16px;
  }

  .credentials-page .input-icon {
    width: 18px;
    height: 18px;
  }

  .credentials-page .toggle-password {
    width: 20px;
    height: 20px;
  }

  .credentials-page .login-card button {
    width: 100%;
    font-size: 18px;
    padding: 12px;
    margin-top: 14px;
    border-radius: 12px;
  }
  
  /* ===============================
     REGISTRATION (mobile spec)
     container: 344px
     names: 172x62
     others: 312px (height as before)
     image: 126x203
     =============================== */

  /* Card container */
  .registration-card {
    width: 344px;
    max-width: 100%;
    border-radius: 16px;
    padding-top: 24px;
    padding-right: 24px;
    padding-bottom: 32px;
    padding-left: 24px;
    margin-top: 32px;
    box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
  }

  /* Stack columns on mobile, but keep image opposite the name fields */
  .registration-card .form-section {
    display: block;
    position: relative;     /* allow absolute positioning of the image */
    min-height: 203px;      /* reserve height so content below doesn't overlap image */
  }
  .registration-card .form-left {
    padding-right: 130px; /* reduced because image is narrower */
  }

  /* Illustration */
  .registration-card .form-right img {
    position: absolute;
    top: 20px;
    right: 8px; /* moved farther right so it doesn’t overlap name inputs */
    width: 110px; /* slightly reduced size */
    height: auto;
    object-fit: contain;
    margin: 0;
  }
  /* Push the next block after the three name fields below the image */
  .registration-card .form-left .form-group:nth-of-type(4) {
    margin-top: 0 !important; /* no artificial gap before date of birth */
  }
  .registration-card .form-group {
    margin-bottom: 12px;
  }

  /* Default inputs on registration (others) — 296px wide, keep height as desktop (32px) */
  .registration-card input[type="text"],
  .registration-card input[type="email"],
  .registration-card input[type="tel"],
  .registration-card input[type="date"],
  .registration-card textarea,
  .registration-card select {
    width: 296px !important;      /* per spec */
    margin-left: 0;
    margin-right: 0;
  }

  /* Keep existing height proportion for non-name inputs */
  .registration-card input[type="email"],
  .registration-card input[type="tel"],
  .registration-card input[type="date"] {
    height: 32px;
  }

  .registration-card input[type="text"] { height: 32px; }

  .registration-card textarea {
    min-height: 100px; /* keep proportions */
  }

 .registration-card .phone-input-wrapper {
  width: 296px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.registration-card .phone-input-wrapper .country-code-select {
  width: 84px;
  height: 32px;          /* все поля по 32px */
  padding: 0 8px;
  font-size: 14px;
}

/* переопределяем width:296px !important для tel */
.registration-card .phone-input-wrapper #phone {
  width: calc(296px - 84px - 8px) !important; /* 204px */
  height: 32px;
  flex: 0 0 auto;
}

  .registration-card .country-code-select {
    width: 84px;
    height: 48px;
    padding: 0 8px;
    font-size: 14px;
  }

  .registration-card #phone {
    flex: 1;
    height: 48px;
  }

  /* --- Names row: first/last/middle — 172 x 62 each --- */
  /* Make the containing .form-group for each name act as inline blocks */
  .registration-card .form-group:has(#firstName),
  .registration-card .form-group:has(#lastName),
  .registration-card .form-group:has(#middleName) {
    display: inline-block;
    vertical-align: top;
    width: 172px;         /* per spec */
    margin: 0 0 12px 0;   /* compact spacing */
    padding-left: 0;      /* align to edges */
    padding-right: 0;
  }

  /* Labels inside inline groups inherit the narrow width automatically */

  /* Inputs themselves: exact 172x62 */
  .registration-card #firstName,
  .registration-card #lastName,
  .registration-card #middleName {
    width: 172px !important;
    height: 62px;
    margin-left: 0;   /* flush to card edge */
    margin-right: 0;
  }

  /* After the 172+172 row, the third (middleName) will wrap naturally to next line */

  /* Radio group width align with others (296) */
  .registration-card .radio-group,
  .registration-card .radio-group label {
    width: 296px;
    margin-left: 0;
    margin-right: 0;
  }

  body.success-page {
    background: #96C194; /* так как фон используется на 3 страницах */
    padding-top: 64px; /* меньше отступ под мобильный header */
  }

  /* Header */
  header {
    height: 64px;
    padding: 8px 12px;
  }

  /* Logo меньше */
  .logo {
    width: 120px;
    height: auto;
    margin-left: 0;
  }

  /* Меняем кнопки на круглые иконки */
  .nav-buttons {
    gap: 8px;
    margin-top: 0;
  }

  .nav-btn {
    min-width: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background-color: transparent;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
  }
  /* hide textual label on tiny icon buttons while keeping accessible name */
  .nav-btn {
    text-indent: -9999px;
    overflow: hidden;
    line-height: 0;
  }

  /* ✅ Подставить свои SVG-иконки */
  .nav-btn:nth-child(1) {
    background: url("assets/arrow-back.svg") center/24px no-repeat;
  }
  .nav-btn:nth-child(2) {
    background: url("assets/home.svg") center/24px no-repeat;
  }

  .nav-btn:hover {
    background-color: rgba(255,255,255,0.15);
  }

  /* Success image (mobile) */
  .success-container {
    min-height: auto;
    padding: 16px 12px 24px;
  }

  .success-image {
    max-width: 80%;
  }

}

/* If a desktop background bleeds through from other sections, keep auth pages on top */
body.auth-bg main,
body:has(.login-card) main {
  position: relative;
  z-index: 1;
}


/* ===== Scrollable text fields ===== */
.scrollable,
.profile-value,
#step2 span,
#step3 span,
.edit-input,
.edit-textarea,
textarea {
  max-height: 220px;        /* десктопный лимит */
  overflow: auto;           /* включаем прокрутку */
  -webkit-overflow-scrolling: touch;
}

/* чтобы длинные слова/ссылки не ломали макет */
.profile-value,
#step2 span,
#step3 span,
.edit-input,
.edit-textarea,
textarea {
  white-space: pre-wrap;
  word-break: break-word;
}

/* на телефонах высота меньше */
@media (max-width: 480px) {
  .scrollable,
  .profile-value,
  #step2 span,
  #step3 span,
  .edit-input,
  .edit-textarea,
  textarea {
    max-height: 160px;
  }
}

  /* ===============================
     PROFILE (mobile adaptation)
     =============================== */

  @media (max-width: 480px) {
    /* Title spec */
    .about-me-title {
      font-family: 'Poppins', sans-serif;
      font-weight: 600;
      font-size: 48px;
      line-height: 56px;     /* readable and centers vertically within line */
      text-align: center;
      vertical-align: middle;
      padding-bottom: 24px;  /* tighter on mobile */
    }

    /* Progress indicator / number pages */
    .progress-indicator {
      gap: 12px;
      margin-bottom: 20px;
    }
    .step {
      width: 58px;           /* number pages width */
      height: 58px;          /* number pages height */
      font-size: 24px;
      border-width: 2px;
    }
    .step-line {
      width: 40px;
    }

    /* Main container for profile steps */
    .profile-card-wrapper {
      margin-top: 16px;
      padding-bottom: 60px;
    }
    #step1 .profile-card,
    #step2 .profile-card,
    #step3 .profile-card {
      width: 344px;          /* main container width */
      max-width: 100%;
      border-radius: 16px;
      padding: 24px;
      box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
    }

    /* Reduce hero top padding so content starts higher on phones */
    .profile-hero {
      padding-top: 220px;
    }

    /* Mobile override for background art */
    .background-top {
      height: 300px;
      background-position: center top;
      background-size: cover;
      top: 64px; 
    }

    /* Rows and labels stack nicely on small screens */
    .profile-row {
      flex-wrap: wrap;
      gap: 6px;
    }
    .profile-label {
      min-width: 0;
      width: 100%;
      margin-bottom: 2px;
    }
    .profile-value-wrapper {
      width: 100%;
      justify-content: space-between;
    }

    /* Textareas/inputs full width inside 344px card */
    .textarea-wrapper,
    .edit-textarea,
    .editable-field input,
    .editable-field .edit-input,
    .editable-field textarea {
      width: 100% !important;
      max-width: 100% !important;
    }
    .edit-textarea {
      min-height: 56px;
    }

    /* Photo size trim so it fits visually */
    .profile-photo-wrapper {
      width: 160px;
      height: 180px;
    }
  }

  .mobile-nav { display: none; } /* скрыт на десктопе */

@media (max-width: 768px) {
  /* мобильный топ-навигационный бар */
  .mobile-nav {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: #fff;
    z-index: 1001; /* над backdrop, под сайдбаром */
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
  }
  .mobile-nav .burger-btn{
    border: 0; background: transparent;
    width: 32px; height: 32px; display: grid; place-items: center;
  }
  .mobile-nav .language-select{ font-family:'Poppins',sans-serif; font-size:14px; }

  /* отступ только если реально используется .mobile-nav; иначе без отступа */
  body{ padding-top:0 !important; }
  body:has(.mobile-nav){ padding-top:56px !important; }

  /* сайдбар как оверлей на всю ширину */
  #sidebar{
    position: fixed;
    top:56px; left:0;
    height: calc(100vh - 56px);
    width:100vw; max-width:100vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index:1002;
  }
  #sidebar.open{ transform: translateX(0); }

  /* стрелку/тоггл прячем в мобиле */
  #sidebar .toggle-button{ display:none; }

  /* backdrop под сайдбар */
  #backdrop{
    display:none; position:fixed; inset:0;
    background: rgba(0,0,0,.4);
    z-index:1000;
  }
  #backdrop.show{ display:block; }

  /* на мобильных не даем "collapsed" визуально прятать логотипы */
  #sidebar .logo,
  #sidebar .logo-collapsed{ display:block !important; }

  .sidebar .logo { display: none; }
  .sidebar .logo-collapsed { display: none !important; }
  .sidebar.open .logo { display: block; }
}

@media (min-width: 769px) {
  .site-header {
    display: none !important;
  }
}

  /* ===== LIBRARY (mobile spec) ===== */
  @media (max-width: 480px) {
    /* Hero illustration width exactly 376px on phone */
    .library-hero .hero-img {
      width: 376px !important;
      max-width: 100%;
      height: auto;
      display: block;
      margin: 0 auto 16px;
    }

    /* Cards behave like tappable buttons with 344px width */
    .library-section {
      align-items: center;
      gap: 16px;
    }
    .library-card {
      width: 344px !important;
      max-width: 100%;
      height: auto;
      padding: 24px;
      border-radius: 16px;
      gap: 12px;
      flex-direction: column;
      align-items: flex-start;
      position: relative;
    }
    .library-card .info {
      width: 100%;
      height: auto;
      padding-right: 56px;
    }
    .library-card .image {
      width: 100%;
      max-width: 280px;
      height: auto;
      align-self: center;
    }
    .library-card .arrow {
      position: absolute;
      right: 16px;
      top: 24px;
      width: 32px;
      height: 32px;
    }

    /* Main header and title spacing on small screens */
    .library-hero {
      width: 100%;
      margin: 40px auto 20px;
    }
    .hero-title {
      font-size: 32px;
      line-height: 40px;
      margin-top: 8px;
    }
  }

  
/* ===== GENERAL MATERIALS (phone): title first, picture under it (284x148), then buttons with "Головна" on its own row ===== */
@media (max-width: 480px) {

  /* Header card on phone */
  .main-header {
    width: 344px;
    max-width: 100%;
    margin: 16px auto 20px;
    padding: 16px;
    border-radius: 16px;
    background: #FFFFF9;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;        /* title above image */
    align-items: center;
    gap: 12px;
  }

  /* Make sure any previous ::before hero is not shown */
  .main-header::before { display: none !important; }

  /* Title on top (Inter font, semi bold, 24px) */
  .main-header h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;              /* Semi Bold */
    font-size: 24px;
    line-height: 30px;
    color: #333;
    text-align: center;
    margin: 0;
    padding: 0;
  }

  /* Picture directly under the title: scalable, fits screen, preserves aspect ratio, not cropped */
  .main-header img {
    display: block !important;
    width: 100%;
    max-width: 284px;
    height: auto;
    aspect-ratio: 284 / 148;
    object-fit: contain;
    object-position: center;
    margin: 0;
    padding: 0;
    border-radius: 12px;
  }

  /* Buttons: grid — first link spans full row ("Головна"), second row has two buttons side-by-side */
  .nav-buttons {
    width: 344px;
    max-width: 100%;
    margin: 0 auto 20px;
    display: grid;
    grid-template-columns: repeat(2, 152px);
    grid-column-gap: 12px;
    grid-row-gap: 12px;
    justify-content: center;     /* centers the 152px columns in 344px */
    align-items: center;
  }
  /* First link spans the first row alone */
  .nav-buttons a:nth-child(1) {
    grid-column: 1 / -1;
    justify-self: center;
  }
  /* All pill buttons identical size */
  .nav-buttons .nav-button {
    width: 152px;
    height: 32px;
    border-radius: 24px;
    padding: 0 12px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  /* Main content card sizing on phone */
  .library-content {
    width: 344px;
    max-width: 100%;
    margin: 20px auto;
    padding: 16px;
    border-radius: 16px;
  }
  .video-thumb { width: 100%; height: 200px; }
  .book-item { padding: 20px; }
}

/* ===== MY COURSES MATERIALS (phone): main container adaptation ===== */
@media (max-width: 480px) {

  /* Main content container for "Матеріали моїх курсів" */
  .materials-library-content {
    width: 344px;
    max-width: 100%;
    margin: 16px auto 24px;
    padding: 16px;
    border-radius: 16px;
    background-color: #FFFDF6;
    box-shadow: -5px 0 5px #2F832F, 5px 0 5px #2F832F;
  }

  /* Date filter compact layout */
  .materials-library-content .date-section {
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .materials-library-content .date-inputs {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: space-between;
    width: 100%;
  }
  .materials-library-content .date-input {
    width: calc(50% - 6px);
    height: 40px;
    box-sizing: border-box;
  }
  .materials-library-content .filter-btn-wrapper {
    justify-content: stretch;
    margin-top: 8px;
  }
  .materials-library-content .filter-btn {
    width: 100%;
    height: 32px;
  }

  /* Buckets and headings */
  .bucket { margin: 16px 0; }
  .bucket-title {
    font-size: 18px;
    margin: 6px 0 10px;
    text-align: left;
  }

  /* Folder sections inside each course */
  .section {
    margin: 8px 0 12px;
    border-radius: 12px;
  }
  .section summary {
    padding: 12px;
    font-size: 16px;
    gap: 8px;
  }
  .materials {
    padding: 10px 12px;
    gap: 10px;
  }

  /* Material rows */
  .material-row {
    padding: 12px;
    border-radius: 10px;
  }
  .row-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .row-head .view-btn {
    width: 100%;
    order: 2;            /* moves button below the title/desc on small screens */
  }
  .material-title { font-size: 16px; }
  .material-desc  { font-size: 13px; line-height: 1.45; }

  /* Preview frame size on phones */
  .preview { margin-top: 8px; }
  .preview iframe,
  .preview embed {
    height: 200px;       /* was 420px on desktop */
    border-radius: 8px;
  }

  /* Course header text sizing */
  .course-item { padding-bottom: 20px; }
  .course-title {
    font-size: 18px;
    text-align: center;
  }
  .course-description {
    font-size: 14px;
    text-align: left;
  }
}