* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 35%, #0ea5e9 100%);
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: background 0.3s ease, padding 0.3s ease;
}

body.workspace-mode {
  background: #f1f5f9;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

:where(.visually-hidden) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where([hidden]) {
  display: none !important;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: min(420px, 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card .lang-switch {
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: #0f172a;
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0ea5e9;
  display: inline-block;
}

.title {
  margin: 16px 0 8px;
  font-size: 24px;
}

.subtitle {
  margin: 0 0 24px;
  color: #475569;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover {
  background: #0284c7;
}

button:active {
  transform: translateY(1px);
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 4px solid #e2e8f0;
  border-top-color: #0ea5e9;
  animation: spin 0.8s linear infinite;
  margin: 10px auto 0;
}

.status {
  margin-top: 16px;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #0f172a;
}

.status.pending {
  background: #e0f2fe;
  color: #0c4a6e;
}

.status.success {
  background: #ecfdf3;
  color: #166534;
}

.status.error {
  background: #fef2f2;
  color: #991b1b;
}

.footer {
  margin-top: 20px;
  font-size: 14px;
  color: #475569;
  text-align: center;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
}

.auth-actions .divider {
  color: #cbd5e1;
}

.muted-link {
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 600;
}

.muted-link:hover {
  text-decoration: underline;
}

.workspace {
  width: 100%;
  min-height: 100vh;
  background: #f8fafc;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.workspace-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 18px;
  z-index: 10;
}

.workspace-header .logo {
  color: #e2e8f0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.lang-label {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}

.lang-switch {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #111827;
  color: #e2e8f0;
  width: auto;
  min-width: 68px;
  flex-shrink: 0;
}

.workspace-body {
  padding: 96px 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  min-width: 260px;
  flex-wrap: nowrap;
}

.user-label,
.plan-label {
  color: #cbd5e1;
  font-size: 12px;
}

.user-name-link {
  color: #e2e8f0;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.user-name-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0ea5e9;
  color: #0f172a;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.plan-pill.clickable {
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.25);
}

.plan-pill.pro {
  background: #0ea5e9;
  color: #0f172a;
}

.plan-pill.base {
  background: #f59e0b;
  color: #0f172a;
}

.logout-btn {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #111827;
  color: #e2e8f0;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: auto;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: #1f2937;
}

.welcome h2 {
  margin: 0 0 8px;
}

.welcome p {
  margin: 0;
  color: #475569;
}

.portlet {
  margin-top: 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.portlet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.portlet-title {
  margin: 0;
  font-size: 18px;
}

.portlet-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 14px;
}

.portlet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-link-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #22c55e;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.3);
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
}

.add-link-btn:hover {
  background: #16a34a;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35);
}

.add-link-btn:active {
  transform: translateY(1px);
}

.links-list {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  text-align: center;
}

.link-card {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.link-meta {
  display: flex;
  flex-direction: column;
  min-width: 170px;
  flex: 1 1 0;
}

.link-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

.trend-badge.success {
  background: #dcfce7;
  color: #166534;
}

.trend-badge.warning {
  background: #fef9c3;
  color: #854d0e;
}

.trend-badge.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.sparkline {
  width: 120px;
  height: 32px;
}

.link-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
}

.link-value {
  font-weight: 700;
  color: #0f172a;
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  flex-shrink: 0;
}

.report-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.report-btn:hover {
  background: #cbd5e1;
}

.report-btn:active {
  transform: translateY(1px);
}

.truncate {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .user-label,
  .plan-label {
    display: none;
  }
  .workspace {
    width: 100%;
  }
  .link-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .truncate {
    max-width: 100%;
  }
  .portlet {
    margin-top: 10px;
  }
}

.profile-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tab-button {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  width: auto;
  min-width: 140px;
  flex: 0 0 auto;
}

.tab-button.active {
  background: #0ea5e9;
  color: #0f172a;
  border-color: #0ea5e9;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
}

.section-subtitle {
  margin: 4px 0 0;
  color: #475569;
}

.foreign-flag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

.badge {
  background: #e2e8f0;
  color: #0f172a;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.form-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
}

.section h3 {
  margin: 0 0 10px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.subsection {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-top: 4px;
}

.subsection h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #0f172a;
}

.form-group.checkbox {
  flex-direction: row;
  align-items: center;
}

.form-group.hint {
  color: #475569;
  font-size: 13px;
}

.form-group input#tax-code {
  max-width: 180px;
}

.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.form-actions .status {
  margin: 0;
}

.primary.small {
  width: auto;
  padding: 8px 14px;
  font-size: 14px;
}

.field-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.error-text {
  color: #b91c1c;
  font-size: 12px;
  margin-top: -6px;
}

.hidden {
  display: none !important;
}

.billing-list .link-card {
  background: #fff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal {
  position: relative;
  width: min(520px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  animation: pop 0.18s ease-out;
}

.modal-title {
  margin: 0 0 6px;
}

.modal-subtitle {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 14px;
}

#modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#modal-form input {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
}

#modal-form input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

#modal-form button {
  align-self: flex-start;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

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

#modal-form .secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-status {
  margin-top: 12px;
  text-align: left;
}

.modal-result {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table td {
  padding: 8px 6px;
  vertical-align: middle;
}

.result-table .result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #0f172a;
  text-decoration: none;
  font-size: 16px;
  transition: background 0.2s, transform 0.1s;
}

.icon-btn:hover {
  background: #cbd5e1;
}

.icon-btn:active {
  transform: translateY(1px);
}

body.modal-open {
  overflow: hidden;
}

@keyframes pop {
  from {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

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

.strength-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 6px 0 10px;
}

.strength-meter .bar {
  height: 6px;
  border-radius: 4px;
  background: #e2e8f0;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.strength-meter .bar.weak {
  background: #f97316;
}

.strength-meter .bar.medium {
  background: #eab308;
}

.strength-meter .bar.strong {
  background: #22c55e;
}

/* Wizard */
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 10px;
}

.card.wide {
  max-width: 1200px;
  width: 95vw;
  margin: 20px auto;
}

.section-subtitle-lite {
  margin: 4px 0 10px;
  font-size: 0.95rem;
  color: #475569;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-weight: 600;
  color: #475569;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wizard-step .circle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #475569;
  background: #fff;
}

.wizard-step.active {
  border-color: #0ea5e9;
  background: #e0f2fe;
  color: #0f172a;
}

.wizard-step.active .circle {
  border-color: #0ea5e9;
  background: #0ea5e9;
  color: #fff;
}

.wizard-step.done {
  border-color: #22c55e;
  background: #ecfdf3;
  color: #14532d;
}

.wizard-step.done .circle {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
}

.wizard-progress {
  position: relative;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: -4px 0 18px;
}

.wizard-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.wizard-pane {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.wizard-pane h3 {
  margin-top: 0;
}

.grid.two-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.grid.two-cols input,
.grid.two-cols select,
.grid.two-cols textarea {
  width: 100%;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  width: min(420px, 90vw);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}

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

.modal-actions .secondary,
.modal-actions .primary {
  min-width: 110px;
  padding: 8px 12px;
}

.modal-actions .secondary {
  background: #e2e8f0;
  color: #0f172a;
}
.wizard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.wizard-actions .spacer {
  flex: 1;
}

.summary-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.95rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row span {
  color: #475569;
}

.payment-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  color: #0f172a;
}

   
 
