/*
 * Developer: MexTech Limited
 * Licenced: Naijasearch is officially licenced and authorized to be used from MexTech Limited
 * Copyright: (c) 2026 All Rights Reserved, MexTech Limited (https://mextechltd.name.ng).
 */

.pw-field {
    position: relative;
    display: block;
}

.pw-field > .input {
    padding-right: 44px;
}

.pw-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    transform: translateY(-50%);
}

.pw-toggle--ready {
    display: flex;
}

.pw-toggle:hover {
    color: var(--ink);
}

.pw-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.pw-toggle__hide,
.pw-toggle[aria-pressed="true"] .pw-toggle__show {
    display: none;
}

.pw-toggle[aria-pressed="true"] .pw-toggle__hide {
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast), transform var(--fast);
}

.btn svg {
    flex: none;
}

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

.btn--primary {
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: 0 1px 2px rgba(var(--shade-rgb), 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn--primary:hover {
    background: var(--brand-strong);
    box-shadow: 0 3px 10px rgba(var(--shade-rgb), 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn--dark {
    background: var(--ink);
    color: var(--on-ink);
}

.btn--dark:hover {
    background: var(--ink-hover);
}

.btn--outline {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn--outline:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
    background: var(--brand-soft-2);
}

.btn--ghost {
    color: var(--ink-2);
}

.btn--ghost:hover {
    background: var(--wash);
    color: var(--ink);
}

.btn--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn--danger:hover {
    background: var(--danger-hover);
}

.btn--sm {
    height: 34px;
    padding: 0 12px;
    font-size: 0.8rem;
    gap: 5px;
}

.btn--lg {
    height: 50px;
    padding: 0 26px;
    font-size: 0.95rem;
    border-radius: var(--r-md);
}

.btn--block {
    width: 100%;
}

.form-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.form-action .btn {
    min-width: 180px;
}

@media (max-width: 560px) {
    .form-action {
        justify-content: stretch;
    }

    .form-action .btn {
        width: 100%;
        min-width: 0;
    }
}

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.btn__spinner {
    display: none;
    flex: none;
    width: 1em;
    height: 1em;
    min-width: 14px;
    min-height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 700ms linear infinite;
}

button.is-busy,
.btn.is-busy {
    cursor: progress;
    pointer-events: none;
}

button.is-busy > .btn__spinner,
.btn.is-busy > .btn__spinner {
    display: inline-block;
}

button.is-busy > svg,
.btn.is-busy > svg {
    display: none;
}

.btn.is-busy[disabled] {
    opacity: 0.8;
}

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

@media (prefers-reduced-motion: reduce) {
    .btn__spinner {
        animation-duration: 1600ms !important;
        animation-iteration-count: infinite !important;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field__label,
.label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: -0.005em;
}

.field__hint,
.help {
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.45;
}

.field__error {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--danger);
}

.input,
.select,
.textarea {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.92rem;
    transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--faint);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.13);
}

.select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d7f75' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    cursor: pointer;
}

.combo {
    position: relative;
}

.combo--on .select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.combo__field {
    position: relative;
}

.combo__input {
    width: 100%;
    height: 44px;
    padding: 0 40px 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.92rem;
    transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}

.combo__input::placeholder {
    color: var(--faint);
}

.combo__input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.13);
}

.combo__toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--muted);
    pointer-events: none;
}

.combo__list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 17.5rem;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(16, 32, 25, 0.16);
}

html[data-theme="dark"] .combo__list {
    box-shadow: var(--sh-4);
}

.combo__list[hidden] {
    display: none;
}

.combo__opt {
    padding: 9px 11px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--ink);
    cursor: pointer;
}

.combo__opt:hover,
.combo__opt.is-active {
    background: var(--surface-2);
    color: var(--brand);
}

.combo__note {
    padding: 9px 11px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
}

.textarea {
    height: auto;
    min-height: 120px;
    padding: 11px 13px;
    line-height: 1.55;
    resize: vertical;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.86rem;
    color: var(--ink-2);
    cursor: pointer;
    line-height: 1.45;
}

.check input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--brand);
    flex: none;
}

.check a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge--featured {
    background: var(--surface);
    color: var(--amber);
    box-shadow: var(--sh-2);
}

.badge--new {
    background: var(--brand);
    color: var(--on-brand);
}

.badge--soft {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.badge--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge--info {
    background: var(--info-soft);
    color: var(--info);
}

.badge--muted {
    background: var(--wash);
    color: var(--ink-3);
}

.badge--success {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.badge--warn {
    background: var(--amber-soft);
    color: var(--amber);
}

.chip-set {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 0.82rem;
    font-weight: 600;
    transition: border-color var(--fast), background var(--fast), color var(--fast);
}

.chip:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
    background: var(--brand-soft-2);
}

.chip--active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--on-brand);
}

.chip--active:hover {
    background: var(--brand-strong);
    color: var(--on-brand);
}

.chip--sm {
    height: 28px;
    padding: 0 10px;
    font-size: 0.76rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.card__head h2,
.card__head h3 {
    margin: 0;
    font-size: 1rem;
}

.card__body {
    padding: 18px;
}

.card__body--flush {
    padding: 0;
}

.panel {
    background: var(--brand-soft-2);
    border: 1px solid var(--brand-line);
    border-radius: var(--r-md);
    padding: 16px 18px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 0.87rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert--error {
    background: var(--danger-soft);
    border-color: var(--danger-line);
    color: var(--danger-ink);
}

.alert--warn {
    background: var(--amber-soft);
    border-color: var(--amber-line);
    color: var(--amber-ink);
}

.alert svg {
    flex: none;
    margin-top: 2px;
}

.alert ul {
    margin: 4px 0 0;
    padding-left: 16px;
    list-style: disc;
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 48px 20px;
    color: var(--muted);
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
}

.empty h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
}

.empty p {
    max-width: 42ch;
    font-size: 0.87rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
    .pagination {
        justify-content: center;
    }

    .pagination .pagination__summary {
        width: 100%;
        margin-right: 0;
        text-align: center;
    }
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: all var(--fast);
}

.pagination a:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
}

.pagination .is-current {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--on-brand);
}

.pagination__dots {
    border: 0;
    background: transparent;
    min-width: 20px;
    padding: 0 2px;
    color: var(--faint);
    font-weight: 600;
}

.pagination__summary {
    border: 0;
    background: transparent;
    min-width: 0;
    margin-right: auto;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    font-weight: 500;
    height: auto;
    line-height: 1.5;
    white-space: nowrap;
}

.pagination__summary strong {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pagination__pages {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    min-width: 0;
    padding: 0;
    height: auto;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    font-size: 0.86rem;
}

.table th {
    text-align: left;
    padding: 11px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: var(--brand-soft-2);
}

.table__thumb {
    width: 52px;
    height: 40px;
    border-radius: var(--r-xs);
    object-fit: cover;
    background: var(--surface-2);
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tabs a {
    padding: 11px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color var(--fast), border-color var(--fast);
}

.tabs a:hover {
    color: var(--ink);
}

.tabs a.is-active {
    color: var(--brand-strong);
    border-bottom-color: var(--brand);
}

.mark {
    background: var(--mark);
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

.pin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
}

.pin svg {
    flex: none;
    opacity: 0.85;
}

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    flex: none;
}

.confidence {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.confidence--high {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.confidence--medium {
    background: var(--amber-soft);
    color: var(--amber);
}

.confidence--low {
    background: var(--wash-2);
    color: var(--ink-3);
}

.reason {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--r-xs);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 0.71rem;
    color: var(--ink-3);
}

.toast-layer {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    width: min(92vw, 420px);
}

@media (min-width: 861px) {
    .toast-layer {
        bottom: 24px;
    }
}

.toast {
    width: 100%;
    padding: 11px 15px;
    border-radius: var(--r-sm);
    background: var(--ink);
    color: var(--on-ink);
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: var(--sh-4);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

.toast.is-in {
    opacity: 1;
    transform: translateY(0);
}

.toast--success {
    background: var(--brand-strong);
}

.toast--error {
    background: var(--danger);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(var(--overlay-rgb), 0.5);
    backdrop-filter: blur(3px);
}

.modal.is-open {
    display: flex;
}

.media-queue {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}
