/* ─── Cards ─── */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--s-24);
}

.card__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--s-16);
}

/* ─── Tab Bar ─── */
.tab-bar {
  display: flex;
  background: var(--color-gray-200);
  border-radius: var(--radius-tab-container);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--s-8);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-gray-500);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  position: relative;
  white-space: nowrap;
}

.tab:hover {
  background: var(--color-sky);
  color: var(--color-navy);
}

.tab--active {
  background: var(--color-navy);
  color: #FFFFFF;
}

.tab--active:hover {
  background: var(--color-navy);
  color: #FFFFFF;
}

.tab--active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-terra);
}

.tab__icon {
  font-size: 14px;
  line-height: 1;
}

/* ─── Form Fields ─── */
.form-group {
  margin-bottom: var(--s-16);
}

.form-group:last-of-type {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-gray-900);
  margin-bottom: var(--s-4);
}

.field-input {
  width: 100%;
  height: 48px;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--color-white);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-gray-900);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-input::placeholder {
  color: var(--color-gray-500);
}

.field-input:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: var(--shadow-focus);
}

.field-input--error {
  border-color: var(--color-error);
}

.field-error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: var(--s-4);
  display: none;
}

.field-input--error ~ .field-error {
  display: block;
}

textarea.field-input {
  height: auto;
  min-height: 100px;
  resize: vertical;
}

/* ─── Select / Dropdown ─── */
.field-select {
  width: 100%;
  height: 48px;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 38px 12px 14px;
  background: var(--color-white);
  font-size: 16px;
  color: var(--color-gray-900);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238E8E93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-select:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: var(--shadow-focus);
}

/* ─── Toggle Switch ─── */
.toggle-group {
  display: flex;
  align-items: center;
  gap: var(--s-12);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch__track {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: background 200ms ease;
}

.toggle-switch input:checked + .toggle-switch__track {
  background: var(--color-navy);
}

.toggle-switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 200ms ease;
}

.toggle-switch input:checked + .toggle-switch__track::after {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-switch__track {
  box-shadow: var(--shadow-focus-visible);
}

.toggle-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-gray-900);
}

/* ─── Generate Button ─── */
.btn-generate {
  width: 100%;
  height: 52px;
  background: var(--color-navy);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  margin-top: var(--s-16);
  cursor: pointer;
  transition: background 150ms ease, transform 80ms ease;
}

.btn-generate:hover {
  background: var(--color-navy-light);
}

.btn-generate:active {
  transform: scale(0.98);
}

.btn-generate:focus-visible {
  box-shadow: var(--shadow-focus-visible);
}

@media (prefers-reduced-motion: no-preference) {
  .btn-generate--shake {
    animation: shake 300ms ease;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ─── QR Preview ─── */
.qr-container {
  width: 250px;
  height: 250px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-placeholder {
  width: 100%;
  height: 100%;
  border: 3px dashed var(--color-gray-200);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-12);
}

.qr-placeholder__icon {
  width: 40px;
  height: 40px;
  color: var(--color-gray-200);
}

.qr-placeholder__text {
  font-size: 14px;
  color: var(--color-gray-500);
  text-align: center;
}

.qr-output {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-output svg {
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .qr-output--fade-in {
    animation: fadeIn 300ms ease;
  }
}

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

/* ─── Action Buttons ─── */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: var(--s-12);
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  padding: 10px 18px;
  border: 2px solid var(--color-navy);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-navy);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.btn-action:hover {
  background: var(--color-navy);
  color: #FFFFFF;
}

.btn-action:active {
  transform: scale(0.98);
}

.btn-action:focus-visible {
  box-shadow: var(--shadow-focus-visible);
}

.btn-action:disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

.btn-action__icon {
  width: 16px;
  height: 16px;
}

/* ─── Form Transitions ─── */
@media (prefers-reduced-motion: no-preference) {
  .form-content--fade-in {
    animation: fadeIn 200ms ease;
  }
}

/* ─── Focus Styles ─── */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-visible);
}

.tab:focus-visible {
  box-shadow: var(--shadow-focus-visible);
}
