/* Default styles */

:root {
  --primary-color: #b2e0eb;
  --secondary-color: #8ec09a;
  --third-color: #fff;
  --text-color: #1a1a1a;
  --max-width-screen: 256px;
  --max-width-responsive: 128px;
}

body, html {
  min-height: 100%;
  margin: 0;
  color: var(--text-color);
  padding-bottom: 5rem; /* space for fixed footer */
}

hr {
  border: none; 
  height: 2px; 
  background-color: var(--secondary-color);
  margin: 20px auto;
  width: 50%;
}

.page-container {
  margin-top: 75px; /* space to avoid to be hidden behind the band */
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 75px);
}

.page-content {
  text-align: center;
}

.settings-btn {
  position: fixed;
  top: 75px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--secondary-color);
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

.settings-btn:hover {
  background: var(--primary-color);
  color: var(--secondary-color);
  transform: rotate(30deg);
}

.settings-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: fill 0.3s;
}

.responsive-img {
  border-radius: 10px;
  max-width: var(--max-width-screen);
  height: auto;
}

h2 {
  color: var(--secondary-color);
  margin-top: 0;
}

label {
  font-weight: bold;
}

.block-form {
  width: var(--max-width-screen);
  margin: 0 auto;
}

.table-form {
  margin: 20px auto;
  width: 50%;
}

input[type="text"] {
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

input[type="email"], input[type="password"] {
  width: 90%;
  padding: 8px;
  margin: 8px 0;
  border: 1px solid var(--secondary-color);
  border-radius: 6px;
}

input[type="submit"] {
  background-color: var(--secondary-color);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 15px;
}

input[type="submit"]:hover {
  opacity: 0.9;
}

input[type="submit"]:disabled {
  background-color: var(--primary-color);
}

.button {
  background-color: var(--primary-color);
  color: var(--text-color);
  border:none; 
  border-radius:10px;
  padding: 8px 16px;
}

.button:hover {
  cursor: pointer;
  opacity: 0.9;
}

.button:disabled{
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.select-input {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: none;
  border-radius: 10px;
  padding: 10px 40px 10px 16px;
  font-size: 15px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffbfd3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}

.error-message {
  color: red;
}

.info-message {
  color:  var(--secondary-color);
}

.band {
  position: fixed;
  top: 0; /* Adjusted to position the band at the top */
  left: 0;
  width: 100%; /* Full width of the screen */
  padding: 15px; /* Adjusted padding */
  background-color: var(--primary-color); /* Set background color to light grey */
  box-sizing: border-box; /* Include padding in width calculation */
  align-items: center;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.title {
  flex-grow: 1;
  text-align: center;
}

.title a,
.title a:visited,
.title a:hover,
.title a:active,
.title a:focus {
    text-decoration: none;
    color: var(--secondary-color);
}

/* Burger icon */
.burger {
  position: fixed;        /* anchor to viewport, not inside band */
  top: 15px;
  left: 15px;
  width: 30px;
  height: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 9999;          /* always above band */
}

.burger span {
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
  display: block;
}

.menu {
  position: fixed;
  top: 50px;
  background: var(--primary-color);
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 6px;
  overflow: hidden;
  width: max-content;
  max-height: 0;
  transition: max-height 0.28s ease;
  z-index: 9998; 
}

.menu a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.menu a:hover {
  opacity: 0.9;
}

#toggle:checked ~ .menu {
  max-height: 400px;
}

/* Language submenu */
.menu-lang-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  color: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease;
}

.menu-lang-trigger::after {
  content: '▾';
  margin-inline-start: 20px;
  transition: transform 0.2s;
}

#lang-toggle:checked ~ .menu .menu-lang-trigger::after {
  transform: rotate(180deg);
}

.menu-lang-sub {
  max-height: 0;
  overflow-y: hidden;
  transition: max-height 0.2s ease;
}

#lang-toggle:checked ~ .menu .menu-lang-sub {
  max-height: 220px;
  overflow-y: auto;
}

.menu-lang-item {
  display: block;
  width: 100%;
  padding-block: 8px;
  padding-inline: 20px 36px;
  color: inherit;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: start;
  box-sizing: border-box;
  transition: opacity 0.15s ease;
}

.menu-lang-item:hover {
  opacity: 0.9;
}

.menu-lang-active {
  font-weight: bold;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

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

.label {
  margin-top: 20px;
  font-size: 18px;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--primary-color);
  transition: .4s;
  opacity: 0.4; /* faded when OFF */
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: var(--secondary-color);
  transition: .4s;
  opacity: 0.6;
}

input:checked + .slider {
   opacity: 1;
}

input:checked + .slider:before {
  transform: translateX(26px);
  opacity: 1; /* knob bright when ON */
}

input:focus + .slider {
    box-shadow: 0 0 2px var(--secondary-color);
  }

/* Rounded style */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

ul {
  padding: 0; 
  margin: 0; 
  text-align: center;
  list-style-type: none;

}

li {
  width: 100%;
}

.toggle-link {
  margin-top: 15px;
  cursor: pointer;
  color: var(--secondary-color);
  text-decoration: underline;
  display: block;
}

.rules {
  text-align: start;
  margin: 10px 0;
  font-size: 0.85em;
}

.rules p {
  margin: 4px 0;
  color: gray;
}

.rules p.valid {
  color: green;
  font-weight: bold;
}

/* Loader overlay */
#loader {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(2px);
  text-align: center;
}

.spinner {
  margin-top: 200px;
  width: 60px; height: 60px;
  border: 6px solid var(--primary-color);
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.spinner-sm {
  width: 16px; height: 16px;
  border: 2px solid var(--primary-color);
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

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

.modal .modal-content {
  background: var(--primary-color);
  padding: 20px;
  margin: 15% auto;
  width: 300px;
  border-radius: 8px;
  text-align: center;
}

.modal .modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.data-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.data-list li {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--secondary-color);
  padding-top: 5px;
  padding-bottom: 5px;
}

.data-list li.header {
  font-weight: bold;
  background: var(--secondary-color);
  color: var(--primary-color);
}

.data-list li.active {
  background-color: var(--primary-color);
  font-weight: bold;
}

.data-list button {
  margin-inline-start: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* RTL overrides */
[dir="rtl"] .settings-btn {
  right: unset;
  left: 20px;
}

[dir="rtl"] .burger {
  left: unset;
  right: 15px;
}

[dir="rtl"] .menu {
  left: unset;
  right: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 6px;
}

[dir="rtl"] .slider:before {
  left: unset;
  right: 4px;
}

[dir="rtl"] input:checked + .slider:before {
  transform: translateX(-26px);
}

[dir="rtl"] body {
  font-size: 1.05em;
  line-height: 1.8;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: var(--max-width-screen);
  margin: 12px auto 0;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: small;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #ccc;
}

.oauth-icons-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 16px;
}

.oauth-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  text-decoration: none;
  background-color: var(--primary-color);
}

.oauth-icon-btn:hover {
  opacity: 0.85;
  background-color: var(--secondary-color);
}

@media screen and (max-width: 750px) {
  .title {
    flex: auto;
  }

  .responsive-img {
    border-radius: 10px;
    max-width: var(--max-width-responsive);
    height: auto;
  }

  .block-form {
    /* max-width: var(--max-width-responsive); */
    max-width: 75%;
    margin: 0 auto;
  }

  hr {
    border: none; 
    height: 2px; 
    background-color: var(--secondary-color);
    margin: 20px auto;
    width: 100%;
  }

  .table-form {
    margin: 20px auto;
    width: 100%;
  }
}

/* === PWA Install Banner === */
.pwa-banner {
  position: fixed;
  bottom: -160px;
  left: 0;
  right: 0;
  background: var(--primary-color);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.18);
  border-radius: 16px 16px 0 0;
  padding: 14px 16px 18px;
  z-index: 1000;
  transition: bottom 0.35s ease;
}

.pwa-banner--visible {
  bottom: 0;
}

.pwa-banner__body {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-right: 28px;
}

.pwa-banner__text {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 0;
}

.pwa-banner__ios-hint {
  font-size: 0.85rem;
  width: 100%;
  line-height: 1.5;
}

.pwa-banner__share-icon {
  font-size: 1.1em;
  vertical-align: middle;
  display: inline-block;
  animation: pwa-bounce 1.4s ease infinite;
}

@keyframes pwa-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

.pwa-banner__dismiss {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  color: inherit;
  line-height: 1;
}

/* === Social media footer === */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 15px;
  text-align: center;
  border-top: 1px solid rgba(0, 117, 213, 0.15);
  background-color: var(--primary-color);
  transition: transform 0.7s ease, opacity 0.7s ease;
}

.site-footer--hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.social-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.social-footer a {
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

.social-footer a:hover {
  opacity: 1;
  transform: scale(1.1);
}

.social-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}