﻿.required::after {
    content: "*";
    font-family: Tahoma;
    color: red;
    padding-left: 3px;
    font-size: 14px;
    line-height: 10px;
}

.card {
    border-radius: 14px;
}

.card-header {
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
}

.table td, .table th {
    vertical-align: middle;
}

code {
    font-size: 0.9em;
}

.badge {
    border-radius: 999px;
}

/* Index polish */
.page-head {
    margin-top: .25rem;
}

.form-row:hover {
    background: rgba(0,0,0,.02);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .5rem;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 999px;
    background: rgba(0,0,0,.02);
}

.empty-state .card {
    border-style: dashed;
}

.table-hover tbody tr:hover,
.table-hover tbody tr:hover > td > a {
    cursor: default;
    font-weight: 700;
}

    .table-hover tbody tr:hover > td > a {
        cursor: pointer;
    }

code {
    background: rgba(0,0,0,.04);
    padding: .1rem .35rem;
    border-radius: .4rem;
}

/* Sticky action bar for field edit */
.sticky-actions {
    position: sticky;
    bottom: 0;
    padding: .75rem;
    background: rgba(255,255,255,.96);
    border-top: 1px solid rgba(0,0,0,.08);
    margin-top: 1.25rem;
}

.builder-table td {
    padding-top: .65rem;
    padding-bottom: .65rem;
}

.builder-label {
    line-height: 1.25;
}

code {
    background: rgba(0,0,0,.04);
    padding: .1rem .35rem;
    border-radius: .4rem;
}

/* Builder accordion cards */
.field-card {
    border-radius: 14px;
}

    .field-card:hover {
        box-shadow: 0 6px 18px rgba(0,0,0,.06);
    }

.field-sec-select {
    min-width: 180px;
}

.list-group-item:hover {
    background: rgba(0,0,0,.02);
}

/* Compact textarea: keep forms tidy but allow multi-row display (rows controls height) */
textarea.compact-textarea {
    resize: vertical;
}

/* Auth (Login) - modern */
.auth-page {
    min-height: 100vh;
    position: relative;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    overflow: hidden;
    background: #0b1020;
}

.auth-bg-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

    .auth-bg-blobs .blob {
        position: absolute;
        filter: blur(42px);
        opacity: 0.55;
        transform: translate3d(0,0,0);
        animation: floaty 10s ease-in-out infinite;
    }

    .auth-bg-blobs .b1 {
        width: 520px;
        height: 520px;
        left: -140px;
        top: -160px;
        background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.95), rgba(99,102,241,0) 60%);
    }

    .auth-bg-blobs .b2 {
        width: 600px;
        height: 600px;
        right: -220px;
        top: 12%;
        background: radial-gradient(circle at 40% 40%, rgba(16,185,129,0.75), rgba(16,185,129,0) 60%);
        animation-delay: -3s;
    }

    .auth-bg-blobs .b3 {
        width: 520px;
        height: 520px;
        left: 18%;
        bottom: -240px;
        background: radial-gradient(circle at 40% 40%, rgba(236,72,153,0.55), rgba(236,72,153,0) 62%);
        animation-delay: -6s;
    }

    .auth-bg-blobs .grain {
        position: absolute;
        inset: -40%;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
        opacity: .25;
        mix-blend-mode: overlay;
        transform: rotate(8deg);
    }

@keyframes floaty {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
    }

    50% {
        transform: translateY(18px) translateX(-10px) scale(1.03);
    }
}

.auth-shell {
    width: 100%;
    max-width: 520px;
    position: relative;
    z-index: 2;
}

.auth-card-modern {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 22px;
    padding: 28px;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 70px rgba(0,0,0,0.40);
    color: #fff;
}

.auth-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
}

.brand-name {
    font-weight: 700;
    letter-spacing: .2px;
}

.brand-sub {
    font-size: 12px;
    opacity: .75;
}

.auth-title {
    font-size: 28px;
    margin: 6px 0 6px;
    letter-spacing: .2px;
}

.auth-desc {
    margin: 0 0 18px;
    opacity: .82;
    line-height: 1.5;
}

.auth-form .field {
    margin-bottom: 14px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    opacity: .9;
}

.field-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
}

.field-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-weight: 700;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    opacity: .85;
}

.field-input {
    flex: 1 1 auto;
    background: transparent;
    border: 0;
    outline: none;
    color: #fff;
    min-width: 0;
}

    .field-input::placeholder {
        color: rgba(255,255,255,0.65);
    }

    /* Chrome / Edge / Safari */
    .field-input:-webkit-autofill,
    .field-input:-webkit-autofill:hover,
    .field-input:-webkit-autofill:focus,
    .field-input:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
        -webkit-text-fill-color: #fff !important;
        caret-color: #fff;
        transition: background-color 9999s ease-in-out 0s;
    }

.field-action {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.88);
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
}

    .field-action:hover {
        background: rgba(255,255,255,0.12);
    }

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #ffb4b4;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 16px;
    flex-wrap: wrap;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.08);
    display: inline-block;
    position: relative;
}

.checkbox-input:checked + .checkbox-box:after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 4px;
    background: rgba(59,130,246,0.95);
}

.checkbox-text {
    font-size: 13px;
    opacity: .9;
}

.auth-hint {
    font-size: 12px;
    opacity: .75;
}

    .auth-hint code,
    .auth-footer code {
        color: rgba(255,255,255,0.92);
        background: rgba(255,255,255,0.10);
        padding: 2px 6px;
        border-radius: 8px;
    }

.auth-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 0;
    color: #fff;
    font-weight: 600;
    letter-spacing: .2px;
    background: linear-gradient(135deg, rgba(59,130,246,0.95), rgba(99,102,241,0.92));
    box-shadow: 0 14px 30px rgba(59,130,246,0.28);
}

    .auth-submit:hover {
        filter: brightness(1.03);
    }

.auth-arrow {
    opacity: .9;
}

.auth-alert {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(239,68,68,0.16);
    border: 1px solid rgba(239,68,68,0.35);
    color: rgba(255,255,255,0.92);
}

.auth-footer {
    margin-top: 16px;
    font-size: 12px;
    opacity: .78;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Auth animations + toast */
.auth-animate-in {
    animation: authIn .55s ease-out both;
}

@keyframes authIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/*.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(10px);
    background: rgba(239,68,68,0.18);
    border: 1px solid rgba(239,68,68,0.38);
    color: rgba(255,255,255,0.94);
    padding: 10px 14px;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    max-width: min(560px, calc(100vw - 28px));
    z-index: 9999;
    font-size: 13px;
}

    .toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }*/


/* Upload loading overlay */
.upload-loading {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.upload-loading-card {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 22px 26px;
    text-align: center;
    min-width: 260px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.custom-switch .form-check-input {
    width: 3.2em;
    height: 1.6em;
    cursor: pointer;
}

    .custom-switch .form-check-input:checked {
        background-color: #198754;
        border-color: #198754;
    }

    .custom-switch .form-check-input:not(:checked) {
        background-color: #dee2e6;
    }

.custom-switch .form-check-label {
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden; /* در ابتدا مخفی است */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

    #loading-overlay.visible {
        visibility: visible;
        opacity: 1;
    }

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.result-box-text {
    padding: .5rem 1rem;
    max-height: 300px;
    overflow: auto;
    margin: .5rem 0;
}

/*tbody > tr:last-child {
    border-bottom-color: transparent !important;
}*/

.form-check-input:disabled ~ .form-check-label,
.form-check-input[disabled] ~ .form-check-label,
.form-check-input:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.mxw-50 {
    max-width: 50%;
}

.table-hover:hover {
}
