/* SecureSite V3 - /public/assets/css/style.css */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #222;
  --muted: #666;
  --border: #d9dde3;
  --accent: #1a73e8;
  --accent2: #0b5bd3;

  --shadow: 0 8px 18px rgba(0, 0, 0, .08);
  --radius: 12px;

  --lang-active-bg: rgba(26, 115, 232, 0.18);
}

[data-theme="dark"] {
  --bg: #121212;
  --card: #1e1e1e;
  --text: #eee;
  --muted: #aaa;
  --border: #333;
  --accent: #4da6ff;
  --accent2: #2f8ef3;
  --shadow: 0 10px 22px rgba(0, 0, 0, .35);
  --lang-active-bg: rgba(250, 250, 250, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.page {
  padding: 18px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.hint {
  color: var(--muted);
  margin-top: 6px;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent2);
  border-color: var(--accent2);
}

/* HEADER / NAVBAR */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
}

.nav-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

/* Top row */
.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Buttons (theme + hamburger) */
.theme-toggle,
.nav-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--accent);
}

/* Hamburger hidden by default */
.nav-toggle {
  display: none;
}

/* Second row links/menu */
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* nav items */
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
}

.nav-link:hover {
  background: rgba(0, 0, 0, .04);
  text-decoration: none;
}

[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, .06);
}

.nav-link.active {
  background: rgba(26, 115, 232, .12);
  border: 1px solid rgba(26, 115, 232, .25);
}

button.nav-link {
  font: inherit;
  cursor: pointer;
}

/* Language picker */
.lang-picker-wrap {
  display: flex;
  align-items: center;
}

.lang-picker {
  position: relative;
  min-width: 0;
}

.lang-picker summary {
  list-style: none;
}

.lang-picker summary::-webkit-details-marker {
  display: none;
}

.lang-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  opacity: 0.85;
}

.lang-picker-toggle:hover {
  border-color: var(--accent);
  opacity: 1;
}

[data-theme="dark"] .lang-picker-toggle {
  background: transparent;
}

.lang-picker-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lang-picker-label,
.lang-picker-option-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0.85;
}

.lang-picker-chevron {
  font-size: 14px;
  line-height: 1;
  color: var(--text);
  transition: transform .18s ease;
}

.lang-picker[open] .lang-picker-chevron {
  transform: rotate(180deg);
}

.lang-picker-flag {
  width: 19px;
  height: 14px;
  display: block;
  border-radius: 2px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .12);
  flex: 0 0 auto;
}

.lang-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 120;
}

.lang-picker-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  text-decoration: none;
}

.lang-picker-option:hover {
  text-decoration: none;
  background: rgba(0, 0, 0, .025);
}

[data-theme="dark"] .lang-picker-option:hover {
  background: rgba(255, 255, 255, .06);
}

.lang-picker-option.active-lang {
  background: var(--lang-active-bg);
  border-color: rgba(26, 115, 232, .35);
}

[data-theme="dark"] .lang-picker-option.active-lang {
  background: rgba(77, 166, 255, .24);
  border-color: rgba(138, 194, 255, .82);
  box-shadow: 0 0 0 1px rgba(138, 194, 255, .20) inset;
}

[data-theme="dark"] .lang-picker-option.active-lang .lang-picker-flag,
[data-theme="dark"] .lang-picker-toggle .lang-picker-flag {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 0 8px rgba(77, 166, 255, .18);
}

/* IMPORTANT: desktop vs mobile picker */
.lang-picker-menu-wrap {
  display: none;
}

/* Mobile behavior */
@media (max-width: 700px) {

  /* Keep burger reachable */
  .nav-toggle {
    display: inline-flex;
  }

  /* Hide desktop picker in top row to avoid overflow */
  .lang-picker-top {
    display: none;
  }

  /* Collapse menu (opened via JS toggling .is-open) */
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-links.is-open {
    display: flex;
  }

  /* Show language picker inside menu */
  .lang-picker-menu-wrap {
    display: block;
    padding: 6px 0 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
  }

  .lang-picker-mobile,
  .lang-picker-mobile .lang-picker-toggle,
  .lang-picker-mobile .lang-picker-menu {
    width: 100%;
  }

  .lang-picker-mobile .lang-picker-menu {
    position: static;
    margin-top: 8px;
  }

  .nav-link,
  button.nav-link {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
}

/* MODALS */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .55);
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
}

.modal-content h2 {
  margin: 0 0 12px 0;
  flex: 0 0 auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  width: 36px;
  height: 32px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  z-index: 2;
}

.modal-close:hover {
  border-color: var(--accent);
}

/* Forms */
.form {
  max-width: 520px;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 6px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-row input,
.form-row textarea,
.form-row select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.form-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

/* Flash */
.flash {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.flash-ok {
  border-color: rgba(46, 125, 50, .35);
  background: rgba(46, 125, 50, .10);
}

.flash-err {
  border-color: rgba(198, 40, 40, .35);
  background: rgba(198, 40, 40, .10);
}

[data-theme="dark"] .flash-ok {
  border-color: rgba(102, 187, 106, .42);
  background: rgba(46, 125, 50, .22);
  color: #e8f5e9;
}

[data-theme="dark"] .flash-err {
  border-color: rgba(239, 83, 80, .44);
  background: rgba(198, 40, 40, .26);
  color: #ffebee;
}

/* Tables */

/* Footer */
.site-footer {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.site-footer .container {
  padding: 14px 18px;
  color: var(--muted);
}

/* Spinner utility */
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(0, 0, 0, .15);
  border-top-color: rgba(0, 0, 0, .55);
  border-radius: 50%;
  display: inline-block;
  animation: spin .8s linear infinite;
  vertical-align: -4px
}

[data-theme="dark"] .spinner {
  border-color: rgba(255, 255, 255, .15);
  border-top-color: rgba(255, 255, 255, .65)
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* Utility classes used in current markup */
.btn-link {
  border: 0;
  background: transparent;
  padding: 8px 10px;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}


.signup-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
.signup-mode-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  cursor: pointer;
}
.signup-mode-card input[type="radio"] {
  margin: 0 0 4px;
}
.signup-mode-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}
.signup-mode-card span {
  color: var(--muted);
  font-size: .95rem;
}
@media (max-width: 700px) {
  .signup-mode-grid {
    grid-template-columns: 1fr;
  }
}


@media (min-width: 701px) {
  .lang-picker-desktop .lang-picker-toggle {
    min-width: 90px;
    justify-content: space-between;
  }
}


/* Admin menu */
.nav-menu {
  position: relative;
}

.nav-menu summary {
  list-style: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.nav-menu-toggle::after {
  content: '▾';
  font-size: 12px;
  line-height: 1;
}

.nav-menu:hover .nav-menu-toggle,
.nav-menu[open] .nav-menu-toggle,
.nav-menu.active .nav-menu-toggle {
  background: rgba(26, 115, 232, .12);
  border-color: rgba(26, 115, 232, .25);
}

.nav-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
  z-index: 30;
}

.nav-menu[open] .nav-menu-list {
  display: flex;
}

.nav-menu-list .nav-link {
  width: 100%;
  justify-content: flex-start;
}

@media (max-width: 700px) {
  .nav-menu {
    width: 100%;
  }

  .nav-menu-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-menu-list {
    position: static;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }
}
