/* Floating guidelines (i) button + modal — user dashboard pages */

[x-cloak] {
    display: none !important;
}

.site-guidelines-help {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 45;
}

.site-guidelines-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    background: linear-gradient(135deg, rgb(99 102 241), rgb(79 70 229));
    color: white;
    box-shadow: 0 8px 24px rgb(99 102 241 / 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: site-guidelines-float 3s ease-in-out infinite;
}

.site-guidelines-btn:hover {
    animation: none;
    transform: scale(1.08);
    box-shadow: 0 12px 32px rgb(99 102 241 / 0.5);
}

.site-guidelines-btn-ring {
    position: absolute;
    inset: -4px;
    border-radius: 9999px;
    border: 2px solid rgb(129 140 248 / 0.6);
    animation: site-guidelines-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
}

@keyframes site-guidelines-ping {
    0% { transform: scale(1); opacity: 0.8; }
    70%, 100% { transform: scale(1.35); opacity: 0; }
}

@keyframes site-guidelines-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.site-guidelines-btn-icon {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.375rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
}

.site-guidelines-backdrop {
    position: fixed;
    inset: 0;
    z-index: 46;
    background: rgb(0 0 0 / 0.75);
    backdrop-filter: blur(4px);
}

.site-guidelines-modal {
    position: fixed;
    z-index: 47;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 32rem;
    max-height: min(85vh, 36rem);
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    border: 1px solid rgb(255 255 255 / 0.12);
    background: rgb(15 23 42 / 0.98);
    box-shadow: 0 24px 64px rgb(0 0 0 / 0.5);
    overflow: hidden;
}

.site-guidelines-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.site-guidelines-modal-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgb(99 102 241 / 0.2);
    color: rgb(165 180 252);
}

.site-guidelines-modal-icon svg {
    width: 1.375rem;
    height: 1.375rem;
}

.site-guidelines-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.site-guidelines-modal-intro {
    font-size: 0.8125rem;
    color: rgb(148 163 184);
    margin: 0.25rem 0 0;
    line-height: 1.45;
}

.site-guidelines-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: rgb(148 163 184);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.site-guidelines-close:hover {
    color: white;
    background: rgb(255 255 255 / 0.08);
}

.site-guidelines-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.site-guidelines-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    counter-reset: guideline-step;
}

.site-guidelines-steps li {
    position: relative;
    padding-left: 2.25rem;
    font-size: 0.875rem;
    color: rgb(203 213 225);
    line-height: 1.5;
    counter-increment: guideline-step;
}

.site-guidelines-steps li::before {
    content: counter(guideline-step);
    position: absolute;
    left: 0;
    top: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: rgb(99 102 241 / 0.25);
    color: rgb(165 180 252);
    font-size: 0.75rem;
    font-weight: 700;
}

.site-guidelines-tips {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(245 158 11 / 0.25);
    background: rgb(245 158 11 / 0.08);
}

.site-guidelines-tips-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(251 191 36);
    margin: 0 0 0.375rem;
}

.site-guidelines-tips ul {
    margin: 0;
    padding-left: 1.125rem;
    font-size: 0.8125rem;
    color: rgb(253 230 138 / 0.9);
}

.site-guidelines-tips li + li {
    margin-top: 0.25rem;
}

.site-guidelines-modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgb(255 255 255 / 0.08);
    background: rgb(2 6 23 / 0.5);
}

.site-guidelines-link {
    font-size: 0.8125rem;
    color: rgb(129 140 248);
    text-decoration: none;
    transition: color 0.15s;
}

.site-guidelines-link:hover {
    color: rgb(165 180 252);
}

.site-guidelines-modal-footer .site-btn-primary {
    margin-left: auto;
}

/* Light theme */
html[data-theme='light'] .site-guidelines-modal {
    background: white;
    border-color: rgb(226 232 240);
    box-shadow: 0 24px 48px rgb(15 23 42 / 0.15);
}

html[data-theme='light'] .site-guidelines-modal-title {
    color: rgb(15 23 42);
}

html[data-theme='light'] .site-guidelines-modal-intro {
    color: rgb(100 116 139);
}

html[data-theme='light'] .site-guidelines-steps li {
    color: rgb(51 65 85);
}

html[data-theme='light'] .site-guidelines-modal-header,
html[data-theme='light'] .site-guidelines-modal-footer {
    border-color: rgb(226 232 240);
}

html[data-theme='light'] .site-guidelines-modal-footer {
    background: rgb(248 250 252);
}

@media (max-width: 639px) {
    .site-guidelines-help {
        bottom: 1rem;
        right: 1rem;
    }

    .site-guidelines-modal-footer .site-btn-primary {
        width: 100%;
        margin-left: 0;
        order: 3;
    }
}

/* Inline field info (i) button — next to form labels */
.site-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.site-label-row .site-label {
    margin-bottom: 0;
}

.site-field-info-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    background: linear-gradient(135deg, rgb(99 102 241), rgb(79 70 229));
    color: white;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: site-field-info-pulse 2.5s ease-in-out infinite;
}

.site-field-info-btn:hover {
    animation: none;
    transform: scale(1.12);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.25);
}

@keyframes site-field-info-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgb(99 102 241 / 0.35); }
    50% { box-shadow: 0 0 0 4px rgb(99 102 241 / 0.12); }
}

.site-field-info-btn-ring {
    position: absolute;
    inset: -3px;
    border-radius: 9999px;
    border: 1px solid rgb(129 140 248 / 0.45);
    animation: site-guidelines-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
}

.site-field-info-btn-icon {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.75rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
}

.site-field-info-body {
    font-size: 0.875rem;
    color: rgb(203 213 225);
    line-height: 1.55;
}

.site-field-info-body ol {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.site-field-info-body li strong {
    color: rgb(226 232 240);
}

.site-field-info-example {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(99 102 241 / 0.25);
    background: rgb(99 102 241 / 0.08);
    font-size: 0.8125rem;
}

.site-field-info-example code {
    display: block;
    margin-top: 0.375rem;
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    color: rgb(165 180 252);
    word-break: break-all;
}

html[data-theme='light'] .site-field-info-body {
    color: rgb(51 65 85);
}

html[data-theme='light'] .site-field-info-body li strong {
    color: rgb(15 23 42);
}

html[data-theme='light'] .site-field-info-example {
    background: rgb(238 242 255);
    border-color: rgb(199 210 254);
}

html[data-theme='light'] .site-field-info-example code {
    color: rgb(79 70 229);
}
