:root {
    --simpletemplate-gold: #D4AF37;
    --simpletemplate-gold-light: #F0D060;
    --simpletemplate-silver: #C0C0C0;
    --simpletemplate-accent-gradient: linear-gradient(135deg, var(--simpletemplate-gold) 0%, var(--simpletemplate-gold-light) 100%);
    --simpletemplate-card-bg: #ffffff;
    --simpletemplate-card-border: rgba(212, 175, 55, .15);
}

@media (prefers-color-scheme: dark) {
    :root {
        --simpletemplate-card-bg: #1a1a2e;
        --simpletemplate-card-border: rgba(212, 175, 55, .25);
    }
}

.myreigiri-prof-search .search-hero {
    background: var(--simpletemplate-accent-gradient);
}

.myreigiri-prof-search .search-hero .card {
    background: var(--simpletemplate-card-bg);
    border-color: var(--simpletemplate-card-border);
}

.myreigiri-prof-search .search-hero .form-control:focus {
    border-color: var(--simpletemplate-gold);
    box-shadow: 0 0 0 .25rem rgba(212, 175, 55, .25);
}

.myreigiri-prof-search .search-hero .btn-primary {
    background-color: var(--simpletemplate-gold);
    border-color: var(--simpletemplate-gold);
    color: #1a1a2e;
    font-weight: 600;
}

.myreigiri-prof-search .search-hero .btn-primary:hover {
    background-color: var(--simpletemplate-gold-light);
    border-color: var(--simpletemplate-gold-light);
}

.myreigiri-prof-search .result-badge {
    background-color: var(--simpletemplate-gold);
    color: #1a1a2e;
}

.myreigiri-prof-search .result-badge.badge-inactive {
    background-color: var(--simpletemplate-silver);
    color: #1a1a2e;
}

.myreigiri-prof-search .field-label {
    color: #6c757d;
    font-weight: 600;
}

.myreigiri-prof-search .field-value {
    color: #1a1a2e;
    font-weight: 500;
}

.myreigiri-prof-search .code-pill {
    background: rgba(212, 175, 55, .08);
    border: 1px dashed var(--simpletemplate-gold);
    color: #1a1a2e;
    font-family: "Courier New", monospace;
}

.myreigiri-prof-search .callout-output {
    background: rgba(212, 175, 55, .06);
    border-left: 3px solid var(--simpletemplate-gold);
}

.myreigiri-prof-search .not-found-code {
    font-size: 4rem;
    font-weight: 800;
    color: var(--simpletemplate-gold);
    line-height: 1;
}

.myreigiri-prof-search .hint-chip {
    background: rgba(212, 175, 55, .1);
    border: 1px solid var(--simpletemplate-card-border);
}

.myreigiri-prof-search .clear-btn {
    display: none;
    transition: opacity .15s ease, color .15s ease;
}

.myreigiri-prof-search .clear-btn.show {
    display: block;
}


.myreigiri-prof-search .copy-feedback {
    opacity: 0;
    transition: opacity .2s ease;
}

.myreigiri-prof-search .copy-feedback.show {
    opacity: 1;
}


/* ===== کانتینر فرم ===== */
.rey-search__form {
    max-width: 640px;
    margin: 0 auto;
}

.rey-search__hint {
    color: #6c757d;
    line-height: 1.8;
}

/* ===== گروه جستجو (فیلد + دکمه) ===== */
.rey-search__group {
    display: flex;
    align-items: stretch;
    gap: 10px;
    background: #fff;
    border: 2px solid #e3e6ea;
    border-radius: 14px;
    padding: 6px;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.rey-search__group:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, .12);
}

/* ===== فیلد ورودی ===== */
.rey-search__field {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0; /* برای allow shrinking در flex */
}

.rey-search__icon {
    position: absolute;
    inset-inline-start: 14px;
    display: flex;
    align-items: center;
    color: #94a3b8;
    pointer-events: none;
    transition: color .2s;
}

.rey-search__field:focus-within .rey-search__icon {
    color: #0d6efd;
}

.rey-search__input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 14px 44px 14px 44px; /* فضای آیکون راست + دکمه پاک چپ */
    font-size: 16px;
    font-family: inherit;
    color: #212529;
    border-radius: 10px;
}

.rey-search__input::placeholder {
    color: #a8b0ba;
}

/* ===== دکمه پاک کردن ===== */
.rey-search__clear {
    position: absolute;
    inset-inline-end: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #eef1f4;
    color: #6c757d;
    cursor: pointer;
    transition: background .2s, color .2s, transform .15s;
}

.rey-search__clear:hover {
    background: #e2e6ea;
    color: #dc3545;
}

.rey-search__clear:active {
    transform: scale(.92);
}

/* ===== دکمه جستجو ===== */
.rey-search__submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, filter .2s;
    box-shadow: 0 4px 12px rgba(13, 110, 253, .25);
}

.rey-search__submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(13, 110, 253, .35);
}

.rey-search__submit:active {
    transform: translateY(1px);
}

.rey-search__submit:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .4);
    outline-offset: 2px;
}

/* ===== حالت لودینگ (اختیاری) ===== */
.rey-search__form.is-loading .rey-search__submit {
    pointer-events: none;
    opacity: .7;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 576px) {
    .rey-search__group {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .rey-search__submit {
        width: 100%;
        padding: 14px 20px;
    }

    .rey-search__input {
        padding: 12px 40px;
    }
}