/* Shared by the wishlist page and the account page: buttons, form fields,
   the billing-details block, the Stripe card field, switches and the toast. */

/* ── Buttons ────────────────────────────────────────────────────────── */
.wl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: 8px; padding: 10px 16px; min-height: 44px;
    font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}
.wl-btn:active { transform: scale(0.97); }
.wl-btn-accent { background: var(--accent); color: #111; }
.wl-btn-accent:hover { background: var(--accent-glow); color: #111; }
.wl-btn-secondary { background: transparent; color: var(--text); border: 1px solid #3a3a3a; }
.wl-btn-secondary:hover { border-color: var(--accent-dim); color: var(--text); }
.wl-btn-ghost { background: none; color: var(--muted); border: 1px solid transparent; }
.wl-btn-ghost:hover { color: var(--text); }
.wl-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.wl-btn-block { width: 100%; }
.wl-btn-lg { min-height: 52px; padding: 14px 20px; font-size: 15px; border-radius: 10px; }
.wl-btn-accent.wl-btn-lg:not(:disabled) { box-shadow: 0 4px 20px rgba(224, 86, 160, 0.3); }
.wl-btn svg { flex-shrink: 0; }

.btn-discord {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: #5865f2; color: #fff; min-height: 44px;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 700;
    border: none; cursor: pointer; text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
    font-family: inherit;
}
.btn-discord:hover { background: #4752c4; color: #fff; }
.btn-discord:active { transform: scale(0.97); }
.btn-discord svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Form fields ────────────────────────────────────────────────────── */
.wl-field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.wl-field-label .optional { color: var(--muted); font-weight: 400; opacity: 0.8; }
.wl-input, .wl-select {
    width: 100%; min-height: 44px; box-sizing: border-box;
    background: var(--log-bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); padding: 10px 12px;
    font-size: 14px; font-family: inherit; outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wl-input:focus, .wl-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 86, 160, 0.18); }
.wl-input:disabled { opacity: 0.5; cursor: not-allowed; }
.wl-input.invalid, .wl-select.invalid { border-color: #ff5f6d; }
.wl-select {
    padding-right: 30px; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237e7e7e' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.wl-select option { background: var(--panel); color: var(--text); }
.wl-field { margin-bottom: 12px; min-width: 0; }
.wl-field:last-child { margin-bottom: 0; }
.wl-field-error { color: #ff5f6d; font-size: 12px; margin-top: 4px; }
.wl-field-error:empty { display: none; }
.wl-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.wl-field-row .wl-field { margin-bottom: 12px; }
.wl-section-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }

/* ── Billing details ────────────────────────────────────────────────── */
.billing-fields { margin-top: 18px; }
.billing-fields-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.billing-fields-hint { font-size: 11px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.billing-more[hidden] { display: none; }
.billing-more-toggle {
    background: none; border: none; color: var(--accent); font-family: inherit; font-size: 12px;
    padding: 6px 0; min-height: 36px; cursor: pointer;
}
.billing-more-toggle:hover { color: var(--accent-glow); }

/* ── Stripe card field ──────────────────────────────────────────────── */
/* Stripe adds StripeElement / --focus / --invalid to the mount node. */
.wl-cardfield {
    box-sizing: border-box; min-height: 50px;
    display: flex; flex-direction: column; justify-content: center;
    background: var(--log-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wl-cardfield > * { width: 100%; }
.wl-cardfield.StripeElement--focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 86, 160, 0.15); }
.wl-cardfield.StripeElement--invalid { border-color: #ff5f6d; }
.wl-card-lock { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 8px; }
.wl-card-note {
    font-size: 12px; color: var(--muted); line-height: 1.5;
    background: #1a1219; border: 1px solid #3a2232; border-radius: 10px; padding: 12px 14px;
}

/* ── Switch (a checkbox styled as a toggle) ─────────────────────────── */
.wl-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.wl-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.wl-switch-track { position: absolute; inset: 0; border-radius: 99px; background: #3a3a3a; transition: background 0.15s ease; }
.wl-switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: left 0.15s ease;
}
.wl-switch input:checked + .wl-switch-track { background: var(--accent); }
.wl-switch input:checked + .wl-switch-track::after { left: 21px; }
.wl-switch input:focus-visible + .wl-switch-track { box-shadow: 0 0 0 3px rgba(224, 86, 160, 0.35); }
.wl-switch input:disabled { cursor: not-allowed; }
.wl-switch input:disabled + .wl-switch-track { opacity: 0.5; }

/* ── Spinner ────────────────────────────────────────────────────────── */
.wl-spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--accent);
    animation: wl-spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes wl-spin { to { transform: rotate(360deg); } }
.wl-spinner.sm { width: 16px; height: 16px; border-width: 2px; margin: 0; }

/* ── Toast ──────────────────────────────────────────────────────────── */
#wl-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
    background: var(--panel); border: 1px solid var(--accent);
    color: var(--text); padding: 10px 18px; border-radius: 10px;
    font-size: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 500; opacity: 0; pointer-events: none; max-width: 90vw;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#wl-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#wl-toast.error { border-color: #ff5f6d; color: #ff5f6d; }
#wl-toast.ok { border-color: var(--green); color: var(--green); }

/* ── Nav on these pages: wrap instead of overflowing on phones ──────── */
nav .nav-inner { flex-wrap: wrap; gap: 8px 12px; }
nav .nav-links { flex-wrap: wrap; align-items: center; row-gap: 6px; }
.wl-nav-auth { display: inline-flex; align-items: center; }
nav .nav-links .wl-nav-signin {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px;
    background: #5865f2; border: none; border-radius: 99px; color: #fff;
    font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
nav .nav-links .wl-nav-signin:hover { background: #4752c4; color: #fff; }
.wl-nav-signin svg { width: 16px; height: 16px; flex-shrink: 0; }
nav .nav-links .wl-user-chip {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 220px;
    padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 99px;
    color: var(--text); font-size: 13px;
}
nav .nav-links .wl-user-chip:hover { border-color: var(--accent-dim); color: var(--text); }
.wl-user-chip .wl-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wl-user-chip svg { flex-shrink: 0; color: var(--muted); }
.wl-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: #5865f2; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.wl-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
