:root {
    color-scheme: light;
    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-muted: #f8fafc;
    --color-border: rgba(15, 23, 42, 0.12);
    --color-border-strong: rgba(15, 23, 42, 0.2);
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-inverse: #f8fafc;
    --color-primary: #2563eb;
    --color-primary-accent: #7c3dff;
    --color-success: #16a34a;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 28px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 44px rgba(15, 23, 42, 0.12);
    --input-bg: #f8fafc;
    --gradient-bg: radial-gradient(
        circle at top,
        #f8fafc,
        #e2e8f0 55%,
        #cbd5f5
    );
    --backdrop-color: rgba(15, 23, 42, 0.45);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #020617;
    --color-surface: rgba(15, 23, 42, 0.92);
    --color-surface-muted: rgba(15, 23, 42, 0.65);
    --color-border: rgba(148, 163, 184, 0.22);
    --color-border-strong: rgba(148, 163, 184, 0.32);
    --color-text-primary: #e2e8f0;
    --color-text-secondary: #cbd5f5;
    --color-text-inverse: #020617;
    --shadow-sm: 0 8px 20px rgba(8, 47, 73, 0.35);
    --shadow-md: 0 16px 32px rgba(8, 47, 73, 0.45);
    --shadow-lg: 0 24px 48px rgba(8, 47, 73, 0.6);
    --input-bg: rgba(15, 23, 42, 0.7);
    --gradient-bg: radial-gradient(
        circle at top,
        #0b1120,
        #020617 55%,
        #000510
    );
    --backdrop-color: rgba(2, 6, 23, 0.7);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

button,
input,
select,
textarea {
    font-family: inherit;
    color: var(--color-text-primary);
    background-color: var(--input-bg);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-secondary);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"] {
    color-scheme: inherit;
}

html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="datetime-local"],
html[data-theme="light"] input[type="month"],
html[data-theme="light"] input[type="time"] {
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
}

html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] input[type="time"] {
    color: var(--color-text-primary);
    background-color: var(--input-bg);
    border: 1px solid var(--color-border);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: transparent;
    padding: 9px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--color-text-primary);
    transition: background 0.2s ease;
}

.ghost-button:hover {
    background: rgba(148, 163, 184, 0.18);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #7c3dff);
    color: var(--color-text-inverse);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(59, 130, 246, 0.25);
}

.primary-button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.file-input {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-input input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px dashed var(--color-border);
    border-radius: 12px;
    background: var(--color-surface-muted);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.file-input-label:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--color-primary);
}

.image-preview {
    margin-top: 10px;
    border: 1px dashed var(--color-border);
    border-radius: 12px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    min-width: 96px;
    background: var(--color-surface-muted, #f8fafc);
}

.image-preview img {
    max-width: 160px;
    max-height: 160px;
    border-radius: 12px;
    object-fit: cover;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list.compact {
    gap: 6px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--color-text-primary);
}

.tag-item button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.45) transparent;
}

*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(
        135deg,
        rgba(37, 99, 235, 0.75),
        rgba(124, 61, 255, 0.65)
    );
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.8),
        rgba(148, 163, 184, 0.6)
    );
}
html[data-theme="light"] {
    color-scheme: light;
}

.cap-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cap-invisible {
    position: relative;
    margin: 24px 0;
}

.cap-visible-panel {
    display: none;
    margin-top: 12px;
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed #d1d5db;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    line-height: 1.7;
    flex-direction: column;
    gap: 10px;
}

html[data-theme="dark"] .cap-visible-panel {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.cap-visible-panel strong {
    font-size: 0.95rem;
    display: block;
}

.cap-visible-panel p {
    margin: 0;
    font-size: 0.85rem;
    color: inherit;
}

.cap-visible-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cap-visible-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cap-visible-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cap-visible-button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
}

.cap-visible-status {
    margin: 0;
    font-size: 0.85rem;
    color: #0f172a;
}

html[data-theme="dark"] .cap-visible-status {
    color: #e2e8f0;
}

.cap-invisible[data-cap-mode="visible"] .cap-visible-panel {
    display: flex;
}

.cap-invisible.cap-visible-confirmed .cap-visible-button {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.lumipay-logo {
    width: 5.5rem;
    border-radius: 1rem;
}
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 2.4rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    cursor: pointer;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: 0.15s ease;
}

.password-toggle:hover {
    opacity: 1;
}

.cropper-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.cropper-modal-backdrop[hidden] {
    display: none !important;
}

.cropper-modal {
    background: var(--color-surface) !important;
    padding: 16px;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    width: min(640px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    opacity: 1 !important;
    margin: 2rem auto;
}
.cropper-drag-box{
    background: none !important;
}

.cropper-wrapper {
    width: 100%;
    min-height: 320px;
    max-height: 60vh;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
}

.cropper-wrapper img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin-inline: auto;
}

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