:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, rgba(124, 58, 237, 0.12), transparent 28%),
    linear-gradient(180deg, #f8f5ff 0%, #f5f7fb 100%);
  color: #111111;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(124, 58, 237, 0.10), transparent 25%),
    linear-gradient(180deg, #f7f4ff 0%, #f8fafc 100%);
  color: #111111;
}

.theme-dark {
  color-scheme: dark;
  background: #0f1117;
  color: #f5f5f5;
}

.page-header {
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  box-shadow: 0 18px 50px -40px rgba(17, 24, 39, 0.18);
}

.theme-dark .page-header {
  background: rgba(15, 17, 23, 0.92);
  border-color: rgba(255, 255, 255, 0.10);
}

.brand-mark {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, #111111 0%, #7c3aed 100%);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.brand-group {
  gap: 0.85rem;
}

.brand-name {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.brand-tagline {
  margin: 0;
  color: #6b7280;
  font-size: 0.92rem;
}

.theme-dark .brand-tagline {
  color: #d1d5db;
}

.hero {
  position: relative;
  padding: 4rem 0 2rem;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -1rem 0 0;
  background: radial-gradient(circle at top center, rgba(124, 58, 237, 0.18), transparent 35%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.35rem, 4vw, 3.75rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

.hero p.lead {
  font-size: 1.05rem;
  color: #4b5563;
}

.workspace {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.08);
}

.theme-dark .workspace {
  background: #171a22;
  color: #f4f7fb;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.28);
}

.tone-textarea {
  min-height: 200px;
  border-radius: 20px;
  font-size: 1rem;
  resize: vertical;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.form-select,
.form-control,
.btn {
  border-radius: 16px;
}

.form-select,
.form-control {
  border: 1px solid rgba(17, 24, 39, 0.12);
}

.theme-dark .text-muted,
.theme-dark .text-secondary {
  color: #b7c0cf !important;
}

.theme-dark .form-label,
.theme-dark h1,
.theme-dark h2 {
  color: #f4f7fb;
}

.theme-dark .form-select,
.theme-dark .form-control {
  background-color: #10131a;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f4f7fb;
}

.theme-dark .form-select:focus,
.theme-dark .form-control:focus {
  background-color: #10131a;
  border-color: rgba(167, 139, 250, 0.72);
  box-shadow: 0 0 0 0.25rem rgba(124, 58, 237, 0.22);
  color: #ffffff;
}

.theme-dark .form-control::placeholder {
  color: #8792a4;
  opacity: 1;
}

.theme-dark .form-select option {
  background-color: #10131a;
  color: #f4f7fb;
}

.theme-dark .alert {
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef2f7;
}

.theme-dark .alert-info {
  background-color: rgba(59, 130, 246, 0.18);
}

.theme-dark .alert-success {
  background-color: rgba(34, 197, 94, 0.18);
}

.theme-dark .alert-warning {
  background-color: rgba(245, 158, 11, 0.20);
}

.theme-dark .alert-danger {
  background-color: rgba(239, 68, 68, 0.18);
}

.result-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(124, 58, 237, 0.12);
}

.theme-dark .result-card {
  background: #12151d;
  border-color: rgba(167, 139, 250, 0.28);
  color: #f4f7fb;
}

.result-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
  padding: 1.25rem;
  background: rgba(245, 245, 245, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.theme-dark .result-text {
  background: #0d1017;
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef2f7;
}

.quick-examples-title {
  color: #4b5563;
  font-size: 0.86rem;
  font-weight: 600;
}

.theme-dark .quick-examples-title {
  color: #d1d5db;
}

.quick-examples-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-example-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(100%, 330px);
  min-height: 36px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.86rem;
  text-align: left;
  line-height: 1.2;
}

.quick-example-button span:first-child {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.10);
  font-weight: 700;
  color: #7c3aed;
}

.quick-example-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-dark .quick-example-button span:first-child {
  background: rgba(196, 181, 253, 0.16);
  color: #c4b5fd;
}

.seo-section {
  max-width: 820px;
  color: #4b5563;
}

.seo-section h2 {
  color: #111111;
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.seo-section p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.seo-section ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.15rem;
}

.theme-dark .seo-section {
  color: #b7c0cf;
}

.theme-dark .seo-section h2 {
  color: #f4f7fb;
}

.auth-page {
  min-height: 100vh;
}

.auth-shell {
  width: min(100% - 2rem, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 3rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-panel {
  width: 100%;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.10);
}

.auth-panel-narrow {
  max-width: 520px;
}

.auth-panel h1 {
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-error {
  margin-top: 0.35rem;
  color: #b91c1c;
  font-size: 0.86rem;
}

.auth-switch {
  margin: 1.25rem 0 0;
  color: #4b5563;
  text-align: center;
}

.auth-switch a {
  color: #5b21b6;
  font-weight: 700;
  text-decoration: none;
}

.account-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.account-list div {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.account-list dt {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.account-list dd {
  margin: 0.2rem 0 0;
  color: #111111;
  font-weight: 600;
}

.language-button,
.current-language-button {
  min-width: 46px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
}

.mobile-language-dropdown {
  display: none;
}

.mobile-language-dropdown .dropdown-menu {
  min-width: 12rem;
  padding: 0.35rem;
  border-radius: 14px;
  border-color: rgba(17, 24, 39, 0.12);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.mobile-language-dropdown .dropdown-item {
  width: 100%;
  display: flex;
  min-height: 38px;
  gap: 0.65rem;
  border-radius: 10px;
}

.mobile-language-dropdown .dropdown-toggle::after {
  display: none;
}

.mobile-language-dropdown .dropdown-item.active,
.mobile-language-dropdown .dropdown-item:active {
  background: rgba(124, 58, 237, 0.12);
  color: #111111;
}

.theme-dark .mobile-language-dropdown .dropdown-menu {
  background: #171a22;
  border-color: rgba(255, 255, 255, 0.14);
}

.theme-dark .mobile-language-dropdown .dropdown-item {
  color: #eef2f7;
}

.theme-dark .mobile-language-dropdown .dropdown-item:hover,
.theme-dark .mobile-language-dropdown .dropdown-item:focus,
.theme-dark .mobile-language-dropdown .dropdown-item.active,
.theme-dark .mobile-language-dropdown .dropdown-item:active {
  background: rgba(124, 58, 237, 0.24);
  color: #ffffff;
}

.theme-toggle-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0.85rem;
  font-weight: 600;
}

.desktop-language-list + .mobile-language-dropdown + .theme-toggle-button,
.lang-switcher .theme-toggle-button {
  margin-left: 0.35rem;
  border-top-left-radius: 16px !important;
  border-bottom-left-radius: 16px !important;
}

.desktop-language-list .language-button:last-child {
  border-top-right-radius: 16px !important;
  border-bottom-right-radius: 16px !important;
}

.flag-icon {
  display: inline-block;
  width: 26px;
  height: 18px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  color: transparent;
}

.flag-icon-br { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='18'><rect width='26' height='18' fill='%2300854d'/><polygon points='13,1 24,9 13,17 2,9' fill='%23ffde2f'/><circle cx='13' cy='9' r='4' fill='%23007aa5'/></svg>"); }
.flag-icon-us { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='18'><rect width='26' height='18' fill='%23b22234'/><rect y='0' width='26' height='2' fill='%23fff'/><rect y='4' width='26' height='2' fill='%23fff'/><rect y='8' width='26' height='2' fill='%23fff'/><rect y='12' width='26' height='2' fill='%23fff'/><rect y='16' width='26' height='2' fill='%23fff'/><rect width='12' height='10' fill='%23005b96'/><g fill='%23fff'><circle cx='3' cy='2' r='1'/><circle cx='6' cy='2' r='1'/><circle cx='9' cy='2' r='1'/><circle cx='3' cy='5' r='1'/><circle cx='6' cy='5' r='1'/><circle cx='9' cy='5' r='1'/></g></svg>"); }
.flag-icon-es { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='18'><rect width='26' height='6' fill='%23c60b1e'/><rect y='6' width='26' height='6' fill='%23ffc400'/><rect y='12' width='26' height='6' fill='%23c60b1e'/></svg>"); }
.flag-icon-fr { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='18'><rect width='8' height='18' fill='%231b4f9c'/><rect x='8' width='10' height='18' fill='%23fff'/><rect x='18' width='8' height='18' fill='%23ed2939'/></svg>"); }
.flag-icon-de { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='18'><rect width='26' height='6' fill='%23000'/><rect y='6' width='26' height='6' fill='%23dd0000'/><rect y='12' width='26' height='6' fill='%23ffce00'/></svg>"); }
.flag-icon-it { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='18'><rect width='8' height='18' fill='%232ca02c'/><rect x='8' width='10' height='18' fill='%23fff'/><rect x='18' width='8' height='18' fill='%23ce2b37'/></svg>"); }

.btn-primary {
  background: #111111;
  border-color: #111111;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #0d0d0d;
  border-color: #0d0d0d;
}

.btn-outline-secondary {
  border-color: rgba(17, 24, 39, 0.12);
  color: #111111;
}

.theme-dark .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.18);
  color: #eef2f7;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.25);
}

.theme-dark .btn-outline-secondary:hover,
.theme-dark .btn-outline-secondary:focus {
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(167, 139, 250, 0.48);
  color: #ffffff;
}

.theme-dark .btn-primary {
  background: #f4f7fb;
  border-color: #f4f7fb;
  color: #111827;
}

.theme-dark .btn-primary:hover,
.theme-dark .btn-primary:focus {
  background: #dbe4f0;
  border-color: #dbe4f0;
  color: #111827;
}

.page-header .btn-outline-secondary {
  color: #111111;
}

.theme-dark .page-header .btn-outline-secondary {
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.18);
}

.theme-dark .page-header .btn-outline-secondary:hover,
.theme-dark .page-header .btn-outline-secondary:focus {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(167, 139, 250, 0.42);
}

@media (max-width: 767px) {
  .page-header {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .page-header .container-fluid {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.65rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .brand-group {
    gap: 0.65rem;
    min-width: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 12px;
    font-size: 0.95rem;
  }

  .brand-name {
    font-size: 1.05rem;
    line-height: 1.15;
  }

  .brand-tagline {
    display: none;
  }

  .header-actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
  }

  .account-link {
    display: none;
  }

  .lang-switcher {
    max-width: 100%;
  }

  .desktop-language-list {
    display: none;
  }

  .mobile-language-dropdown {
    display: inline-flex;
  }

  .language-button,
  .current-language-button,
  .theme-toggle-button {
    min-width: 38px;
    min-height: 36px;
    padding: 0.4rem;
  }

  .flag-icon {
    width: 22px;
    height: 15px;
  }

  .theme-toggle-button {
    width: 42px;
    padding-inline: 0.45rem;
    font-size: 0;
  }

  .lang-switcher .theme-toggle-button {
    margin-left: -1px;
  }

  .theme-toggle-button::before {
    content: '\263e';
    font-size: 1rem;
    line-height: 1;
  }
}

@media (max-width: 420px) {
  .page-header .container-fluid {
    gap: 0.5rem !important;
  }
}
