/* Design System Components
 * Extracted patterns for reuse across templates
 */

/* === CARD === */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 440px;
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
}

/* === HEADER === */
.header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.logo {
  display: inline-block;
  margin-bottom: var(--space-lg);
}

.logo-mark {
  width: 140px;
  height: 140px;
}

.logo-mark img,
.logo-mark svg {
  width: 100%;
  height: 100%;
}

.invited-by {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-xs);
}

.invited-by strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* === TITLES === */
.title,
.welcome {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.title {
  font-size: var(--text-3xl);
}

.title em,
.welcome em {
  font-style: italic;
  font-weight: 300;
  color: var(--primary);
}

.subtitle {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 400;
  color: var(--text-secondary);
}

/* === DIVIDER === */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider-text {
  font-family: var(--font-serif);
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* === SERVICES LIST === */
.services {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: var(--space-xl);
}

.service {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: var(--space-md) 1.125rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  transition: background var(--transition-base);
}

.service:hover {
  background: var(--bg-hover);
}

.service-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.service-icon svg,
.service-icon img {
  width: 100%;
  height: 100%;
}

.service-content {
  flex: 1;
  min-width: 0;
}

.service-name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.service-name .amp {
  font-style: italic;
  font-weight: 300;
  color: var(--primary-muted);
}

.service-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* === BUTTONS === */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-lg);
  font-weight: 500;
  font-family: var(--font-serif);
  color: var(--bg);
  background: var(--primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-base),
    gap var(--transition-slow),
    transform var(--transition-fast),
    box-shadow var(--transition-base);
}

.btn-primary:hover {
  background: var(--primary-hover);
  gap: 0.75rem;
  box-shadow: var(--shadow-primary);
}

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

.btn-primary .arrow {
  font-style: italic;
  font-weight: 300;
  transition: transform var(--transition-slow);
}

.btn-primary:hover .arrow {
  transform: translateX(2px);
}

/* === BACK LINK === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color var(--transition-base);
}

.back-link:hover {
  color: var(--text-secondary);
}

.back-link .arrow {
  font-family: var(--font-serif);
  font-style: italic;
  transition: transform var(--transition-base);
}

.back-link:hover .arrow {
  transform: translateX(-2px);
}

/* === PROGRESS DOTS === */
.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background var(--transition-slow), transform var(--transition-slow);
}

.progress-dot.complete {
  background: var(--primary-muted);
}

.progress-dot.active {
  background: var(--primary);
  transform: scale(1.25);
}

/* === FORM === */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* === FIELDSET === */
.fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.fieldset-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.fieldset-legend::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.fieldset-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* === FIELDS === */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.label-italic {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  font-weight: 400;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  padding: 0.75rem var(--space-md);
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.input::placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

.input:hover {
  border-color: var(--text-tertiary);
}

.input:focus {
  outline: none;
  border-color: var(--primary-muted);
  box-shadow: var(--ring-focus);
}

.input-readonly {
  background: var(--bg);
  border-style: dashed;
  color: var(--text-secondary);
  cursor: not-allowed;
}

.input-readonly:hover,
.input-readonly:focus {
  border-color: var(--border);
  box-shadow: none;
}

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

.input-error:focus {
  box-shadow: var(--ring-error);
}

/* Chip Selector (multi-select) */
.chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.chip:hover {
  background: var(--bg-hover);
  border-color: var(--primary-muted);
  color: var(--text);
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg);
}

.chip .check {
  width: 0;
  height: 14px;
  opacity: 0;
  transition: width 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.chip.selected .check {
  width: 14px;
  opacity: 1;
}

/* === FIELD HINTS & STATUS === */
.field-hint {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-style: italic;
}

.field-hint::before {
  content: "\2192"; /* right arrow */
  color: var(--primary-muted);
  font-style: normal;
}

.field-error {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--error);
}

.field-error::before {
  content: "\2192";
  font-style: normal;
}

.field-success {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--primary);
}

.field-success::before {
  content: "\2713"; /* checkmark */
}

/* === ANNOTATION === */
.annotation {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-md);
}

.annotation-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.annotation-icon svg {
  width: 100%;
  height: 100%;
}

.annotation-content {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.annotation-content strong {
  color: var(--text);
  font-weight: 600;
}

/* === PASSWORD STRENGTH (Smooth Bar) === */
.password-strength {
  margin-top: var(--space-sm);
}

.password-meter {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.password-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.password-meter-fill[data-strength="1"] {
  width: 25%;
  background: var(--error);
}

.password-meter-fill[data-strength="2"] {
  width: 50%;
  background: var(--warning);
}

.password-meter-fill[data-strength="3"] {
  width: 75%;
  background: var(--warning-hover);
}

.password-meter-fill[data-strength="4"] {
  width: 100%;
  background: var(--primary);
}

.password-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-style: italic;
}

/* === AVATAR PICKER (Accessible) === */
.avatar-picker {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) 0;
}

.avatar-option {
  position: relative;
}

.avatar-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.avatar-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-avatar);
  border: 2px solid transparent;
  transition: all var(--transition-slow);
}

.avatar-option input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.avatar-option input[type="radio"]:checked + label {
  border-color: transparent;
  box-shadow: var(--shadow-avatar), var(--ring-selected);
}

.avatar-option label:hover {
  box-shadow: var(--shadow-avatar-hover);
  transform: scale(1.08);
}

/* Avatar colors */
.avatar-botanical { background: var(--primary); color: var(--bg); }
.avatar-amber { background: var(--warning); color: var(--surface); }
.avatar-rose { background: var(--error); color: var(--surface); }
.avatar-ink { background: var(--text); color: var(--bg); }
.avatar-lavender { background: var(--accent); color: var(--surface); }

/* Custom avatar add button */
.avatar-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 2px dashed var(--text-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform var(--transition-base), border-color var(--transition-base), border-style var(--transition-base);
}

.avatar-add:hover {
  transform: scale(1.08);
  border-color: var(--primary-muted);
  border-style: solid;
}

.avatar-plus {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
}

/* ==========================================================================
   AVATAR PICKER V2 (Flip-style with decorative icons)
   ========================================================================== */

.avatar-picker-v2 {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-md) 0;
  perspective: 800px;
}

/* Hidden radio for form submission */
.avatar-picker-v2 input[type="radio"],
.avatar-picker-v2 input[type="hidden"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* === LETTERS TRIGGER (First Icon) === */
.avatar-letters-trigger {
  position: relative;
  width: 52px;
  height: 52px;
}

.avatar-letters-btn {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  border: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-avatar);
  transition: all var(--transition-base);
}

/* Scale Breath: subtle idle animation indicating interactivity */
@keyframes scale-breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.avatar-letters-btn:not(:hover):not(.selected) {
  animation: scale-breath 2.5s ease-in-out infinite;
}

.avatar-letters-btn:hover {
  animation: none;
  transform: scale(1.08);
  box-shadow: var(--shadow-avatar-hover);
}

.avatar-letters-btn.selected {
  animation: none;
  box-shadow: var(--shadow-avatar), var(--ring-selected);
}

/* Indicator chevron - shows "click to change color" */
.avatar-change-indicator {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-muted);
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

.avatar-change-indicator svg {
  width: 10px;
  height: 10px;
}

.avatar-letters-btn:hover + .avatar-change-indicator,
.avatar-letters-trigger:hover .avatar-change-indicator {
  opacity: 1;
}

/* When colors are showing, indicator points up (back) */
.avatar-picker-v2.show-colors .avatar-change-indicator svg {
  transform: rotate(180deg);
}

/* === FLIP SLOTS (Botanical -> Color) === */
.avatar-flip-slot {
  position: relative;
  width: 48px;
  height: 48px;
}

.avatar-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.avatar-picker-v2.show-colors .avatar-flip-inner {
  transform: rotateY(180deg);
}

/* Front (decorative icons) and back (colors) faces */
.avatar-flip-front,
.avatar-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.avatar-flip-back {
  transform: rotateY(180deg);
}

/* Botanical icon buttons */
.avatar-botanical-icon {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--bg);
  border: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-avatar);
  transition: all var(--transition-base);
}

.avatar-botanical-icon svg {
  width: 22px;
  height: 22px;
}

.avatar-botanical-icon:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-avatar-hover);
}

.avatar-botanical-icon.selected {
  box-shadow: var(--shadow-avatar), var(--ring-selected);
}

/* Color choice buttons (back of flip) */
.avatar-color-choice {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  box-shadow: var(--shadow-avatar);
  transition: all var(--transition-base);
}

.avatar-color-choice:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-avatar-hover);
}

.avatar-color-choice.selected {
  box-shadow: var(--shadow-avatar), var(--ring-selected);
}

.avatar-color-choice[data-color="botanical"] {
  background: var(--primary);
  color: var(--bg);
}

.avatar-color-choice[data-color="amber"] {
  background: var(--warning);
  color: var(--surface);
}

.avatar-color-choice[data-color="rose"] {
  background: var(--error);
  color: var(--surface);
}

.avatar-color-choice[data-color="ink"] {
  background: var(--text);
  color: var(--bg);
}

/* === UPLOAD BUTTON (Last Icon) === */
.avatar-upload-slot {
  position: relative;
  width: 48px;
  height: 48px;
}

.avatar-upload-btn {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 2px dashed var(--text-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-avatar);
  transition: all var(--transition-base);
}

.avatar-upload-btn svg {
  width: 20px;
  height: 20px;
}

.avatar-upload-btn:hover {
  border-style: solid;
  border-color: var(--primary-muted);
  transform: scale(1.08);
}

/* Upload indicator */
.avatar-upload-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--bg);
  border-radius: var(--radius-full);
  border: 2px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-upload-indicator svg {
  width: 8px;
  height: 8px;
  color: var(--text-secondary);
}

/* === FOOTER === */
.footer {
  margin-top: var(--space-lg);
  text-align: center;
}

.footer-text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.footer-link {
  color: var(--primary-muted);
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === ALERTS === */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error);
  color: var(--error);
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--primary);
  color: var(--primary);
}

/* === HTMX STATES === */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Success card variant */
.card-success {
  border: 1px solid var(--primary);
  background: rgba(61, 90, 69, 0.08);
}

/* ==========================================================================
   ADMIN COMPONENTS
   ========================================================================== */

/* === ADMIN CARD VARIANT === */
.card-wide {
  max-width: 900px;
  padding: var(--space-xl);
}

/* === ADMIN HEADER (Centered Rotary Layout) === */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  gap: var(--space-md);
}

.admin-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text);
  /* Fixed width prevents layout shift when title changes */
  min-width: 180px;
  flex: 0 0 auto;
}

.admin-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--primary);
}

.user-info {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  /* Match title width for balance */
  min-width: 180px;
  flex: 0 0 auto;
  text-align: right;
}

.logout-link {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-decoration: none;
  margin-top: var(--space-xs);
  opacity: 0.7;
  transition: all var(--transition-base);
}

.logout-link:hover {
  color: var(--primary);
  opacity: 1;
}

/* === ADMIN SECTIONS === */
.admin-section {
  margin-bottom: var(--space-lg);
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-md);
}

/* === FORM ROW (Inline Form) === */
.form-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  min-width: 140px;
}

.form-group-submit {
  flex: 0 0 auto;
  min-width: auto;
  align-self: flex-start;
  margin-top: 1.65rem; /* Align with inputs (label height + gap) */
}

.form-group-chips {
  flex: 1 1 auto;
  min-width: 200px;
}

.btn-create {
  white-space: nowrap;
  padding: 0.75rem var(--space-lg);
}

.invite-result {
  margin-top: var(--space-md);
}

/* Hide OOB elements that land here temporarily - modal-backdrop uses position:fixed so it still shows */
/* Also show field-error for validation messages */
.invite-result > :not(.modal-backdrop):not(.field-error) {
  display: none;
}

/* === ADMIN TABLE === */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
}

.table th {
  background: var(--bg);
  color: var(--text);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: var(--text-sm);
  border-bottom: 2px solid var(--primary);
}

.table th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.table th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.table td {
  background: var(--surface);
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  vertical-align: top;
}

.table tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius-md);
}

.table tr:last-child td:last-child {
  border-radius: 0 0 var(--radius-md) 0;
}

.table tr:hover td {
  background: var(--bg);
}

.group-name {
  font-weight: 500;
  color: var(--text);
}

.invite-email {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.created-date {
  color: var(--text);
}

.created-by {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.actions-cell {
  min-width: 180px;
}

.action-buttons {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.no-actions {
  color: var(--text-tertiary);
}

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-active {
  background: var(--primary);
  color: var(--bg);
}

.badge-expired {
  background: var(--error);
  color: var(--surface);
}

.badge-used {
  background: var(--text-secondary);
  color: var(--bg);
}

/* === BUTTON VARIANTS === */
.btn-danger {
  background: var(--error);
  color: var(--surface);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: opacity var(--transition-base), transform var(--transition-fast);
}

.btn-danger:hover {
  opacity: 0.9;
}

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

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: var(--text-sm);
}

.btn-primary.btn-sm {
  width: auto;
  padding: 0.4rem 0.8rem;
  font-size: var(--text-sm);
}

.btn-copied {
  background: var(--primary-muted) !important;
}

/* === URL BOX === */
.url-box {
  background: var(--bg);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  word-break: break-all;
  font-family: monospace;
  font-size: var(--text-xs);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-xl);
  background: var(--bg);
  border-radius: var(--radius-lg);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.empty-hint {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-style: italic;
}

/* ==========================================================================
   MODAL COMPONENTS
   ========================================================================== */

/* === MODAL BACKDROP === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 39, 35, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modal-fade-in 0.2s ease-out;
  padding: var(--space-md);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === MODAL CARD === */
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow:
    0 25px 50px -12px rgba(43, 39, 35, 0.25),
    0 0 0 1px rgba(61, 90, 69, 0.08);
  max-width: 420px;
  width: 100%;
  padding: var(--space-xl);
  animation: modal-slide-up 0.25s ease-out;
  position: relative;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* === MODAL HEADER === */
.modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.modal-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon svg {
  width: 20px;
  height: 20px;
  color: var(--bg);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text);
  margin: 0;
}

.modal-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--primary);
}

/* === MODAL CONTENT === */
.modal-content {
  margin-bottom: var(--space-lg);
}

.modal-url {
  background: var(--bg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-family: monospace;
  font-size: var(--text-sm);
  word-break: break-all;
  color: var(--text-secondary);
  user-select: all;
  line-height: 1.5;
}

.modal-hint {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* === MODAL ACTIONS === */
.modal-actions {
  display: flex;
  gap: var(--space-sm);
}

.modal-actions .btn-primary {
  flex: 1;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 500;
  font-family: var(--font-serif);
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
  color: var(--text);
}

/* === CLOSE BUTTON === */
.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base), color var(--transition-base);
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text-secondary);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}
