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

body {
  background: #0d0d0d;
  font-family: 'Helvetica Neue', Helvetica, Arial, 'Segoe UI', sans-serif;
  color: #f5f5f5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

input::placeholder,
textarea::placeholder {
  color: #8a8a8e;
  opacity: 1;
}

a {
  color: #8b8fd4;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #242426;
}

.site-header img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: block;
}

.main-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 16px 72px;
}

.page-title {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: #fff;
}

.page-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: #a1a1aa;
  margin: 0 0 32px;
  max-width: 520px;
}

.required {
  color: #8b8fd4;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 15px;
  font-weight: 600;
  color: #f5f5f5;
}

.field-error {
  font-size: 13px;
  color: #f87171;
}

.input-ring {
  border-radius: 12px;
}

.input-ring.error {
  box-shadow: 0 0 0 2px #f87171;
}

.input,
.textarea,
.date-trigger {
  height: 60px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  color: #f5f5f5;
  outline: none;
  background: #2b2b2d;
  width: 100%;
  font-family: inherit;
}

.input:focus,
.textarea:focus {
  border-color: #8b8fd4;
  box-shadow: 0 0 0 3px rgba(139, 143, 212, 0.25);
}

.textarea {
  min-height: 140px;
  padding: 16px 18px;
  resize: vertical;
  line-height: 1.5;
  height: auto;
}

.date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.date-trigger:hover {
  border-color: #5a5a5e;
}

.date-trigger .placeholder {
  color: #8a8a8e;
}

.date-wrap {
  position: relative;
}

.char-count {
  font-size: 12px;
  color: #8a8a8e;
  align-self: flex-end;
}

.divider {
  height: 1px;
  background: #242426;
  margin: 6px 0;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a8a8e;
}

.security-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.security-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  background: #2b2b2d;
}

.security-option:hover {
  border-color: #5a5a5e;
}

.security-option.selected {
  border-color: #8b8fd4;
}

.radio-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #6a6a6e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.radio-dot-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}

.security-option.selected .radio-dot-inner {
  background: #8b8fd4;
}

.btn-submit {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #8b8fd4;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
}

.btn-submit:hover {
  background: #7a7ece;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.consent {
  font-size: 14px;
  color: #a1a1aa;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

.consent a {
  color: #8b8fd4;
  text-decoration: underline;
}

.submit-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.cal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.cal-popup {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  z-index: 50;
  width: 288px;
  background: #1c1c1e;
  border: 1px solid #3a3a3c;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 14px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-nav {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  cursor: pointer;
  font-size: 20px;
  color: #d4d4d8;
  border: none;
  background: transparent;
}

.cal-nav:hover {
  background: #2e2e30;
}

.cal-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-weekdays {
  margin-bottom: 4px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: #8a8a8e;
  font-weight: 600;
}

.cal-day {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  color: #e4e4e7;
  background: transparent;
}

.cal-day:hover {
  background: #2e2e30;
}

.cal-day.selected {
  border-color: #8b8fd4;
  background: #8b8fd4;
  color: #fff;
}

.cal-day.today {
  border-color: #5a5a5e;
}

.cal-day.empty {
  visibility: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.18s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #1c1c1e;
  border: 1px solid #2e2e30;
  border-radius: 18px;
  padding: 40px 32px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.22s ease-out;
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #8b8fd4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.modal h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: #fff;
  letter-spacing: -0.01em;
}

.modal p {
  font-size: 14px;
  color: #a1a1aa;
  margin: 0 0 26px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: #8b8fd4;
  color: #fff;
}

.btn-primary:hover {
  background: #7a7ece;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.center-card {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  gap: 16px;
}

.login-card {
  background: #1c1c1e;
  border: 1px solid #2e2e30;
  border-radius: 18px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 24px;
}

.login-card .field {
  margin-bottom: 16px;
}

.login-error {
  color: #f87171;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: left;
}

.logs-page {
  max-width: 100%;
  padding: 24px 16px 48px;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.logs-header h1 {
  font-size: 24px;
}

.btn-logout {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #3a3a3c;
  background: #2b2b2d;
  color: #f5f5f5;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
}

.btn-logout:hover {
  border-color: #f87171;
  color: #f87171;
}

.logs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: #1c1c1e;
  border: 1px solid #242426;
  border-radius: 12px;
}

.logs-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.logs-filter-field label {
  font-size: 13px;
  font-weight: 600;
  color: #a1a1aa;
}

.logs-filter-search {
  flex: 1 1 220px;
  min-width: 200px;
}

.logs-filter-field .input {
  height: 44px;
  font-size: 14px;
}

.logs-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-filter-primary,
.btn-filter-secondary {
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-filter-primary {
  background: #8b8fd4;
  color: #fff;
}

.btn-filter-primary:hover {
  background: #7a7ece;
}

.btn-filter-secondary {
  background: #2b2b2d;
  color: #f5f5f5;
  border-color: #3a3a3c;
}

.btn-filter-secondary:hover {
  border-color: #8b8fd4;
}

.logs-filter-error {
  color: #f87171;
  font-size: 14px;
  margin: 0 0 12px;
}

.logs-filter-error.hidden {
  display: none;
}

input[type="date"] {
  color-scheme: dark;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #242426;
  border-radius: 12px;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}

.logs-table th,
.logs-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #242426;
  vertical-align: top;
}

.logs-table th {
  background: #1c1c1e;
  color: #a1a1aa;
  font-weight: 600;
  white-space: nowrap;
}

.logs-table tr:last-child td {
  border-bottom: none;
}

.logs-table tr:hover td {
  background: #161618;
}

.event-visit {
  color: #a1a1aa;
}

.event-submit {
  color: #8b8fd4;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination button {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #3a3a3c;
  background: #2b2b2d;
  color: #f5f5f5;
  cursor: pointer;
  font-family: inherit;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button:not(:disabled):hover {
  border-color: #8b8fd4;
}

.pagination-info {
  color: #a1a1aa;
  font-size: 14px;
}

.logs-loading,
.logs-empty {
  text-align: center;
  color: #a1a1aa;
  padding: 48px 16px;
}

.access-denied {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 20px;
}
