:root {
  --color-green: #1fb796;
  --color-green-dark: #00848b;
  --color-ink: #163245;
  --color-bronze: #8d7142;
  --color-red: #fb5740;
  --color-page: #f3faf8;
  --color-panel: #ffffff;
  --color-border: #dce9e7;
  --color-muted: #5f737a;
  --font-main: 'Montserrat', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 30px 20px;
  font-family: var(--font-main);
  color: var(--color-ink);
  background:
    linear-gradient(180deg, rgba(31, 183, 150, 0.08), rgba(255, 255, 255, 0) 280px),
    var(--color-page);
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(31, 183, 150, 0.12), rgba(255, 255, 255, 0) 300px),
    #10202b;
}

.twx-hero {
  width: min(1100px, 100%);
  min-height: 330px;
  margin: 0 auto 40px;
  padding: 48px 48px 72px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 52px;
  overflow: hidden;
  position: relative;
  border-radius: 0 0 24px 24px;
  background:
    linear-gradient(90deg, rgba(7, 37, 47, 0.86), rgba(13, 93, 99, 0.48)),
    url("hero-property.png") center / cover no-repeat,
    #163245;
  box-shadow: 0 24px 60px rgba(22, 50, 69, 0.18);
}

.twx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 30, 39, 0.26), rgba(14, 108, 112, 0.08));
  opacity: 0.9;
}

.twx-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--color-green), var(--color-bronze));
}

.twx-header-img {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  width: fit-content;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.logo {
  width: clamp(220px, 29vw, 300px);
  height: auto;
  display: block;
}

.twx-header-content {
  position: relative;
  z-index: 1;
}

.twx-header-content h1 {
  max-width: 820px;
  margin: 0 0 18px;
  color: #ffffff;
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
}

.twx-header-content p {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1rem, 1.9vw, 1.35rem);
  line-height: 1.25;
  font-weight: 800;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.42);
}

.twx-hero-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 46px;
  padding: 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.24);
}

.twx-container {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 34px 32px 32px;
  background: var(--color-panel);
  border: 1px solid rgba(220, 233, 231, 0.9);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(22, 50, 69, 0.1);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark .twx-container {
  background: #163245;
  border-color: rgba(31, 183, 150, 0.22);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.twx-form-row {
  display: grid;
  grid-template-columns: 140px 190px minmax(260px, 1fr);
  gap: 18px;
}

.twx-form-group {
  display: flex;
  flex-direction: column;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-ink);
  font-size: 0.98rem;
  font-weight: 800;
}

body.dark label {
  color: #ffffff;
}

select,
input[type="text"] {
  width: 100%;
  min-height: 48px;
  margin: 0 0 20px;
  padding: 0 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-ink);
  background: #ffffff;
  font: 600 1rem var(--font-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, color 0.3s ease;
}

select:focus,
input[type="text"]:focus {
  border-color: var(--color-green-dark);
  box-shadow: 0 0 0 4px rgba(31, 183, 150, 0.14);
}

select {
  cursor: pointer;
}

input[readonly] {
  color: var(--color-muted);
  background: #f8fbfa;
}

body.dark select,
body.dark input[type="text"] {
  color: #ffffff;
  background: #102735;
  border-color: rgba(255, 255, 255, 0.18);
}

body.dark input[readonly] {
  color: rgba(255, 255, 255, 0.72);
  background: #10202b;
}

button {
  min-height: 52px;
  padding: 0 32px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--color-green);
  font: 800 1rem var(--font-main);
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(31, 183, 150, 0.2);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  background: var(--color-green-dark);
  box-shadow: 0 14px 28px rgba(0, 132, 139, 0.22);
  transform: translateY(-1px);
}

.result {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1.5px solid rgba(31, 183, 150, 0.55);
  border-radius: 8px;
  color: var(--color-ink);
  background: rgba(31, 183, 150, 0.1);
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(31, 183, 150, 0.08);
}

body.dark .result {
  color: #ffffff;
  background: rgba(31, 183, 150, 0.14);
  border-color: rgba(31, 183, 150, 0.7);
}

.generated-list {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

body.dark .generated-list {
  border-top-color: rgba(255, 255, 255, 0.14);
}

.generated-list h2 {
  margin: 0 0 12px;
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 800;
}

body.dark .generated-list h2 {
  color: #ffffff;
}

.generated-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(220, 233, 231, 0.75);
}

body.dark .generated-item {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.generated-item strong,
.generated-item span {
  display: block;
}

.generated-item strong {
  margin-bottom: 4px;
  color: var(--color-green-dark);
  font-size: 0.92rem;
}

body.dark .generated-item strong {
  color: var(--color-green);
}

.generated-item span {
  color: var(--color-ink);
  font-size: 0.95rem;
  font-weight: 700;
}

body.dark .generated-item span {
  color: #ffffff;
}

.generated-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.generated-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(31, 183, 150, 0.35);
  border-radius: 8px;
  color: var(--color-ink);
  background: rgba(31, 183, 150, 0.08);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 800;
}

.generated-actions button:hover {
  color: #ffffff;
  background: var(--color-green-dark);
  box-shadow: none;
  transform: none;
}

body.dark .generated-actions button {
  color: #ffffff;
  background: rgba(31, 183, 150, 0.12);
  border-color: rgba(31, 183, 150, 0.45);
}

.warning {
  margin-top: 16px;
  color: var(--color-red);
  font-weight: 800;
}

.twx-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(1, 12, 17, 0.72);
}

.twx-modal.is-open {
  display: flex;
}

.twx-modal-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(31, 183, 150, 0.22);
  border-radius: 18px;
  color: #ffffff;
  background: #0f3142;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.twx-modal-card h2 {
  margin: 0 0 16px;
  color: var(--color-green);
  font-size: 1.1rem;
  font-weight: 800;
}

.twx-modal-card p {
  margin: 0 0 22px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
}

.twx-modal-card label {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
}

.twx-modal-card input[type="text"] {
  min-height: 46px;
  margin: 0 0 18px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
}

.twx-modal-card input[type="text"]:focus {
  border-color: var(--color-green);
  box-shadow: 0 0 0 4px rgba(31, 183, 150, 0.16);
}

.twx-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.twx-modal-card button {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--color-green);
  box-shadow: none;
  font-size: 0.9rem;
}

.twx-modal-card button:hover {
  background: var(--color-green-dark);
  box-shadow: none;
  transform: none;
}

.twx-modal-actions button + button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.twx-modal-actions button + button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.twx-theme-switch {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 5px 15px 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

body.dark .twx-theme-switch {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.18);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex: 0 0 auto;
  line-height: 0;
  margin: 0;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 50%;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.switch input:checked + .slider {
  background: rgba(31, 183, 150, 0.72);
  border-color: rgba(255, 255, 255, 0.32);
}

.switch input:checked + .slider::before {
  transform: translate(20px, -50%);
}

#theme-label {
  display: flex;
  align-items: center;
  height: 30px;
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.24);
}

body.dark #theme-label {
  color: #ffffff;
}

.twx-footer {
  width: min(860px, 100%);
  margin: 42px auto 0;
  padding: 0 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-muted);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.15;
  font-weight: 800;
}

.twx-footer strong,
.twx-footer span {
  display: block;
  width: 100%;
}

.twx-footer strong {
  color: #002f3d;
  font-size: 0.95rem;
  line-height: 1.1;
}

body.dark .twx-footer {
  color: rgba(255, 255, 255, 0.72);
}

body.dark .twx-footer strong {
  color: #ffffff;
}

@media (max-width: 700px) {
  body {
    padding: 16px 14px;
  }

  .twx-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 36px;
    margin-bottom: 24px;
    padding: 84px 24px 86px;
  }

  .twx-hero-badge {
    top: 18px;
    right: 18px;
    min-width: 146px;
    height: 40px;
    padding: 0 20px;
    font-size: 0.9rem;
  }

  .twx-header-img {
    width: fit-content;
    height: auto;
  }

  .logo {
    width: min(250px, 72vw);
  }

  .twx-container {
    padding: 24px 18px;
    border-radius: 14px;
  }

  .twx-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .generated-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .generated-actions {
    width: 100%;
  }

  .generated-actions button {
    flex: 1;
  }

  button {
    width: 100%;
  }

  .twx-theme-switch {
    right: 14px;
    bottom: 14px;
  }
}
