@font-face {
  font-family: "Rubik";
  src: url("/static/fonts/Rubik-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Rubik";
  src: url("/static/fonts/Rubik-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

body {
  font-family: "Rubik", sans-serif;
  background: #ffeef5;
  color: #4c2a38;
  padding: 40px;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-petal h2 {
  font-weight: 400;
  margin-bottom: 25px;
  font-size: 24px;
  color: #7a3259;
}

.form-petal input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  background: #fff9fc;
  transition: 0.3s;
}

.form-petal input:focus {
  border-color: #ec7cab;
  outline: none;
  box-shadow: 0 0 0 2px rgba(236, 124, 171, 0.3);
}

.form-petal button {
  background: #ec7cab;
  border: none;
  color: white;
  padding: 12px 30px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.3s;
}

.form-petal button:hover {
  background: #d55d96;
}

.login-link {
  margin-top: 20px;
  font-size: 14px;
}

.login-link a {
  color: #c65385;
  text-decoration: none;
  font-weight: bold;
}

.login-link a:hover {
  text-decoration: underline;
}

.flash.success {
  background: #d0f8d0;
  color: #2e7d32;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.flash.error {
  background: #ffe2e2;
  color: #c62828;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.top-left {
  position: absolute;
  top: 10px;
  left: 10px;
}

.top-right {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-link {
  display: block;
}

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  transition: border 0.2s;
  display: block;
}

.avatar-link:hover .avatar-img {
  border-color: #aaa;
}

.admin-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  border-radius: 8px;
  transition: background 0.2s;
}

.admin-icon:hover {
  background: #ddd;
}

.admin-icon img {
  width: 20px;
  height: 20px;
}

.notif-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  border-radius: 8px;
  transition: background 0.2s;
}

.notif-icon:hover {
  background: #ddd;
}

.notif-icon img {
  width: 20px;
  height: 20px;
}

.top-right a:hover img {
  border-color: #ccc;
}

.top-left a {
  text-decoration: none;
  font-size: 1.2em;
  background: #eee;
  padding: 6px 12px;
  border-radius: 8px;
  color: #333;
  transition: background 0.2s;
}

.top-left a:hover,
.top-right a:hover {
  background: #ddd;
}

.profile-wrapper {
  display: flex;
  max-width: 900px;
  margin: 40px auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
  background: #fff0f7;
}

.profile-sidebar {
  width: 250px;
  background: #ffddea;
  padding: 30px 20px;
  text-align: center;
  border-right: 2px solid #f7cadd;
}

.avatar {
  width: 100px;
  height: 100px;
  background: url('https://www.svgrepo.com/show/384674/avatar-girl.svg') no-repeat center;
  background-size: contain;
  border-radius: 50%;
  margin: 0 auto 20px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.profile-sidebar h2 {
  font-size: 20px;
  margin-bottom: 30px;
  color: #7a3259;
}

.profile-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-menu li {
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #ffcfe5;
  color: #7a3259;
  font-weight: bold;
  transition: 0.2s;
}

.profile-menu li:hover,
.profile-menu li.active {
  background: #f9bdd5;
}

.profile-content {
  padding: 40px;
  flex-grow: 1;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 30px auto 10px;
  max-width: 900px;
}

.avatar-small {
  width: 60px;
  height: 60px;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.profile-top h2 {
  font-size: 22px;
  color: #7a3259;
  margin: 0;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-modal {
  position: absolute;
  top: 80px;
  left: 0px;
  display: none;
  background: #fff8fc;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  z-index: 1000;
}

.tab-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto 20px;
  border-bottom: 2px solid #f5c8da;
  padding-bottom: 10px;
}

.tab-nav .tab {
  color: #c65385;
  font-weight: 600;
  text-decoration: none;
  padding-bottom: 6px;
  transition: 0.2s;
  position: relative;
}

.tab-nav .tab.active::after {
  content: '';
  display: block;
  height: 3px;
  background: #c65385;
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  border-radius: 2px;
}

.tab-nav .tab:hover {
  color: #9d3c6b;
}

.tab-content {
  max-width: 860px;
  margin: 20px auto;
  padding: 25px;
  background-color: rgba(255, 240, 245, 0.5);
  backdrop-filter: blur(3px);
  border-radius: 15px;
  border: 1px solid rgba(255, 200, 220, 0.4);
  box-shadow: 0 4px 10px rgba(255, 180, 210, 0.15);
}

#tests h3 {
  text-align: center;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 15px;
}

.avatar-option {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.avatar-option:hover {
  transform: scale(1.1);
}

.logout {
  margin-left: auto;
  background: #ffc0cb;
  color: #850049;
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.2s;
}

.logout:hover {
  background: #f799b7;
}

.question-block {
  padding: 20px;
  border: 2px dashed #dca3b3;
  border-radius: 12px;
  background: #fff3f7;
  box-sizing: border-box;
}

.pretty-select {
  padding: 8px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #d48e9f;
  margin-bottom: 10px;
  background-color: #fff0f5;
  color: #4c2a38;
}

.constructor-form-input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  background: #fff9fc;
  transition: 0.3s;
  box-sizing: border-box;
}

.constructor-form-input:focus {
  border-color: #ec7cab;
  outline: none;
  box-shadow: 0 0 0 2px rgba(236, 124, 171, 0.3);
}

.answers-wrapper {
  width: 100%;
  box-sizing: border-box;
}

.answer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

.answer-item input[type="radio"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  align-self: center;
  accent-color: #d48e9f;
  position: relative;
  top: -8px;
}

.answer-label {
  margin-left: 8px;
  cursor: pointer;
}

.answer-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  align-self: center;
  accent-color: #d48e9f;
  position: relative;
  top: -8px;
}

.answer-item input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid #dca3b3;
  background-color: white;
  color: #4c2a38;
  outline: none;
  min-width: 0;
}

#theme-toggle {
  background: #eee;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: #333;
  transition: background 0.2s;
}

#theme-toggle:hover {
  background: #ddd;
}


body.dark-theme {
  background-color: #121212;
  color: #f0f0f0;
}

body.dark-theme .container {
  background-color: #1e1e1e;
  border-radius: 10px;
  padding: 20px;
}

body.dark-theme {
  background-color: #121212;
  color: #f0f0f0;
}

body.dark-theme .form-petal,
body.dark-theme .tab-content,
body.dark-theme .profile-content,
body.dark-theme .avatar-modal {
  background: #1e1e1e;
  color: #f0f0f0;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

body.dark-theme .profile-sidebar {
  background: #2a2a2a;
  border-right: 2px solid #444;
}

body.dark-theme input,
body.dark-theme .constructor-form-input,
body.dark-theme input[type="text"],
body.dark-theme .pretty-select {
  background: #2e2e2e;
  color: #f0f0f0;
  border: 1px solid #555;
}

body.dark-theme input:focus,
body.dark-theme .constructor-form-input:focus {
  border-color: #ec7cab;
  box-shadow: 0 0 0 2px rgba(236, 124, 171, 0.3);
}

body.dark-theme button,
body.dark-theme .form-petal button,
body.dark-theme .logout-button {
  background: #ec7cab;
  color: #121212;
}

body.dark-theme .logout-button:hover,
body.dark-theme .form-petal button:hover {
  background: #d55d96;
}

body.dark-theme .top-left a,
body.dark-theme .top-right a,
body.dark-theme .admin-icon {
  background: #2c2c2c;
  color: #eee;
}

body.dark-theme .top-left a:hover,
body.dark-theme .top-right a:hover,
body.dark-theme .admin-icon:hover {
  background: #3a3a3a;
}

body.dark-theme .tab-nav {
  border-bottom: 2px solid #444;
}

body.dark-theme .tab-nav .tab {
  color: #ff85af;
}

body.dark-theme .tab-nav .tab.active::after {
  background: #ff85af;
}

body.dark-theme .tab-nav .tab:hover {
  color: #ffafc4;
}

body.dark-theme .question-block {
  background: #262626;
  border-color: #b96d8c;
}

body.dark-theme .answer-item input[type="text"] {
  background: #333;
  border: 1px solid #666;
  color: #f0f0f0;
}

body.dark-theme .flash.success {
  background: #2a4730;
  color: #9df79d;
}

body.dark-theme .flash.error {
  background: #4c1f1f;
  color: #ffbdbd;
}

body.dark-theme .profile-menu li {
  background: #3a2b31;
  color: #ffb3c6;
}

body.dark-theme .profile-menu li:hover,
body.dark-theme .profile-menu li.active {
  background: #4e2f3c;
}

body.dark-theme .avatar-img {
  border-color: #555;
}

body.dark-theme .avatar-img:hover {
  border-color: #888;
}

body.dark-theme #theme-toggle {
  background: #2c2c2c;
  color: #eee;
}

body.dark-theme #theme-toggle:hover {
  background: #3a3a3a;
}

.content-inner {
  background: #fff0f7;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

body.dark-theme .content-inner {
  background: #1e1e1e;
}

body.dark-theme .page-content {
  background: none;
}

.create-test-btn {
  display: inline-block;
  margin-top: 20px;
  background: #ffc0cb;
  color: #850049;
  padding: 10px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.2s ease;
}

.create-test-btn:hover {
  background: #f799b7;
}


.answer-label {
  display: block;
  background: #ffeaf2;
  border: 1px solid #e5b4c2;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  word-wrap: break-word;
  white-space: normal;
  overflow-wrap: break-word;
  max-width: 100%;
  transition: background 0.2s ease;
}

.answer-label:hover {
  background: #ffd6e0;
}

.answer-input:checked + .answer-label {
  background: #ffc2d1;
  border-color: #ff90a0;
}

.constructor-form-input {
  width: 100%;
  min-height: 40px;
  padding: 8px;
  border: 1px solid #e5b4c2;
  border-radius: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

textarea {
  box-sizing: border-box;
  overflow: hidden;
  min-height: 40px;
  line-height: 1.4;
}

.form-petal {
  background: linear-gradient(135deg, #fff 0%, #ffeaf2 100%);
  padding: 40px;
  border-radius: 25px;
  max-width: 400px;
  margin: 60px auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  position: relative;
  animation: floatIn 0.6s ease-out;
}

.test-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: left;
  max-width: 100%;
  display: block;
}

.question-text {
  max-width: 100%;
  box-sizing: border-box;
}

.question-type {
  max-width: 80%;
  box-sizing: border-box;
}

.match-line.correct {
  color: green;
}
.match-line.wrong {
  color: red;
}

.flower-tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.flower-card {
  background-color: #fff0f5;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(255, 182, 193, 0.3);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease;
  align-items: center;
  text-align: center;
}

.flower-card:hover {
  transform: scale(1.02);
}

.flower-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #6b003b;
  text-shadow: 0 0 1px #ffbee1;
  text-align: center;
}

.flower-btn {
  background-color: #4CAF50;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.flower-btn:hover {
  background-color: #45a049;
}

.no-tests {
  color: #888;
  font-style: italic;
}

.student-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding: 0 12px;
}

.student-card {
  background: #fff0f4;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.student-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 4px;
}

.student-time {
  opacity: 0.75;
  font-size: 0.9em;
}

.student-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffc0cb;
}

.student-history-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  background-color: #ffc0cb;
  color: #850049;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.student-history-btn:hover {
  background-color: #f799b7;
}

.back-btn {
  margin-left: auto;
  background: #ffc0cb;
  color: #850049;
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.2s;
}

.back-btn:hover {
  background: #f799b7;
}

.history-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.history-card {
  background: #fff0f5;
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 4px 10px rgba(255, 182, 193, 0.2);
}

.history-title {
  font-weight: 600;
  color: #6b003b;
  margin-bottom: 6px;
}

.history-date {
  font-size: 0.9em;
  color: #555;
}

.open-result-btn {
  display: inline-block;
  margin-top: 8px;
  background: #c65385;
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.open-result-btn:hover {
  background: #a9396a;
}

.with-student-info {
  padding-top: 24px;
}

.student-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.student-inline-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffc0cb;
  background: white;
}

.student-inline-name {
  font-weight: bold;
  font-size: 1.1em;
  color: #7a3259;
}

.student-profile-box {
  display: flex;
  align-items: center;
  margin: 30px 0 20px 0;
  gap: 20px;
}

.student-big-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 192, 203, 0.5);
}

.student-fullname {
  font-weight: bold;
  font-size: 20px;
  color: #82295c;
}

.result-button {
  display: inline-block;
  margin-top: 12px;
  background: #ffc0cb;
  color: #fff;
  padding: 8px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.2s ease;
}

.result-button:hover {
  background: #f799b7;
}

#flash-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

.flash-message {
  color: #4a0033;
  padding: 12px 20px;
  border-radius: 10px;
  margin: 15px auto;
  max-width: 600px;
  font-weight: 500;
  font-size: 15px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-10px);
  animation: fade-slide 0.6s ease-out forwards;
}

.flash-message.error {
  background-color: rgba(255, 182, 193, 0.6);
  border: 1px solid rgba(255, 105, 135, 0.4);
}
.flash-message.success {
  background-color: rgba(200, 255, 200, 0.6);
  border: 1px solid rgba(100, 200, 100, 0.4);
}
.flash-message.warning {
  background-color: rgba(255, 200, 245, 0.6);
  border: 1px solid rgba(255, 120, 200, 0.4);
}

@keyframes fade-slide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 0.95;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  0% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-20px); }
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 8px;
  gap: 4px;
}

.controls button {
  all: unset;
  width: 20px;
  height: 20px;
  border: 1px solid #dba8b8;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #d97393;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  background-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.controls button:hover {
  background-color: #ffeef3;
  color: #c75474;
  border-color: #c75474;
}

.test-card.completed {
  opacity: 0.6;
  filter: grayscale(1);
}

.test-card .flower-btn.disabled {
  pointer-events: none;
  background-color: #ccc;
  color: #666;
  cursor: default;
}

.test-divider-line {
  width: 100%;
  height: 1px;
  background-color: #bbb;
  margin: 30px 0;
}

.remove-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: 0.2s ease;
  width: 60px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px; /* 👈 сдвигаем вниз вручную */
}

.remove-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

.remove-btn img {
  display: block;
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.1));
}

