/**
 * Reasons to Stay - Main Styles
 * WCAG 2.2 AA Compliant
 * Black & white color scheme with paper texture
 */

:root {
    --rts-white: #FAFAFA;
    --rts-cream: #F8F7F4;
    --rts-black: #1A1A1A;
    --rts-gray-dark: #2C2C2C;
    --rts-gray-mid: #4A4A4A;
    --rts-gray-light: #E5E5E5;
    --rts-shadow: rgba(0,0,0,0.08);
    --rts-shadow-strong: rgba(0,0,0,0.15);
}

/* Onboarding option hover/focus: creamy pill highlight (all breakpoints) */
.rts-onboarding-option:hover,
.rts-onboarding-option:focus-within {
    background: #f6efe3;
    border-radius: 999px;
}

/* ==========================================
   LETTER VIEWER
   ========================================== */
.rts-form-input {
    background: #ffffff !important;
    color: #182437 !important;
    border-radius:10px;
}
.rts-letter-viewer {
    width: 100%;
    padding: 0;
}

/* Typewriter font for letter titles and standalone headings */
.rts-letter-signature {
    font-family: 'Special Elite', 'Courier New', monospace;
}

.rts-letter-signature {
    font-size: 20px;
    font-style: normal;
}

/* Loading state */
.rts-loading {
    text-align: center;
    padding: 60px 20px;
}

.rts-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--rts-gray-light);
    border-top-color: var(--rts-black);
    border-radius: 50%;
    animation: rts-spin 0.8s linear infinite;
}

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

.rts-loading p {
    margin-top: 20px;
    color: var(--rts-gray-mid);
    font-size: 16px;
}

/* Letter card with paper effect */
.rts-letter-card {
    background: transparent;
    /* Extra top padding to make room for top-left tag icons */
    padding: 100px 100px 50px;
    position: relative;
    margin-bottom: 0px;
}

/* Top-left tag icons (Feedback / Report) */
.rts-letter-top-tags{
    position: absolute;
    top: 35px;
    left: -45px; /* sit outside the paper */
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    z-index: 3;
}

.rts-tag-btn{
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rts-black);
    color: var(--rts-white);
    border: 2px solid var(--rts-black);
    border-radius: 0px; /* square-ish tag */
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.rts-tag-btn:hover{
    transform: translateY(-1px);
    color: #FCA311;
    box-shadow: 0 6px 14px var(--rts-shadow);
}

.rts-tag-btn:focus-visible{
    outline: 3px solid #FCA311;
    outline-offset: 3px;
}

.rts-tag-btn i{
    font-size: 18px;
    line-height: 1;
}

/* Tooltip label (hover + keyboard focus) */
.rts-tag-btn::after{
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    left: 54px; /* show label to the right of the tag */
    background: rgba(7, 12, 19, 0.95);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.rts-tag-btn:hover::after,
.rts-tag-btn:focus-visible::after{
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Card footer keeps Next button visually attached to the letter */


/* Site stats row - [rts_site_stats_row] */
.rts-stats-row{
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 35px;
    width: 100%;
    margin: 0;
}

.rts-stat{
    background: transparent;
    border: none;
    text-align: center;
}

.rts-stat-number{
    font-weight: 700;
    font-size: clamp(28px, 3.2vw, 44px);
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    line-height: 1;
    color: var(--rts-black);
}

.rts-stat-label{
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--rts-gray-mid);
}

/* Paper texture overlay */
.rts-letter-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
    border-radius: 2px;
}

/* Removed: stacked paper layer pseudo-element.
   It was rendering as a stray "container" at the bottom of the letter card. */


.rts-letter-footer {
  z-index: 1;
  position: relative;
  display: flex;
  justify-content: space-between; /* Pushes buttons to edges */
  align-items: center;
  gap: 15px;
  margin-top: 2rem;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--rts-black);
}

/* Prevent buttons from becoming full-width on desktop */
.rts-letter-footer .rts-btn {
    background-color: #F1E3D3;
    color: #000000;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    min-width: 120px;
    display: inline-flex;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rts-letter-content p {
    margin-bottom: 1.2em;
    font-size: 1.1rem;
    line-height: 1.6rem;
}

.rts-letter-content p:last-child {
    margin-bottom: 0;
}

/* Letter signature */
.rts-letter-signature {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--rts-gray-light);
    text-align: right;
    font-size: 16px;
    color: var(--rts-gray-mid);
}

/* Card footer: centers Next button inside the letter */
.rts-letter-card-footer{
    margin-top: 26px;
    display: flex;
    justify-content: center;
}

/* Fade in animation */
.rts-letter-display {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.rts-letter-display.rts-fade-in {
    opacity: 1;
}

/* ==========================================
   LETTER ACTIONS
   ========================================== */

.rts-letter-actions{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  margin-top:22px;
}
/* Footer icon buttons (Feedback / Report) */
.rts-letter-actions .rts-trigger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding: 10px 12px;
    min-height: 44px;
    min-width: 44px;
    border-radius: 14px;
    border: 1px solid rgba(7,12,19,0.18);
    background: rgba(7,12,19,0.06);
    color: var(--rts-black);
    cursor:pointer;
}

.rts-letter-actions .rts-trigger:hover{
    background: rgba(7,12,19,0.10);
}

.rts-letter-actions .rts-trigger:focus-visible{
    outline: 3px solid rgba(252,163,17,0.55);
    outline-offset: 2px;
}

/* Primary button (Next Letter) */
.rts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 22px;
    background: #F1E3D3;
    color: var(--rts-black);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Special Elite', monospace;
    font-size: .85rem;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 40px;
    min-width: 48px;
}

.rts-btn:hover {
    background-color: #000000;
    color: #ffffff;
}

.rts-btn:focus-visible {
    outline: 3px solid var(--rts-black);
    outline-offset: 3px;
}

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

/* ==========================================
   QUICK RATING PROMPT (shown on Next)
   ========================================== */

.rts-rate-prompt {
    width: 100%;
    display: flex;
    max-width: 100%;
    padding: 25px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.rts-rate-text {
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 14px;
    color: var(--rts-gray-dark);
}

.rts-rate-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.rts-rate-btn {
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.15);
    background: var(--rts-white);
    color: var(--rts-black);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rts-rate-btn:hover {
    border-color: var(--rts-pink);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--rts-shadow);
}

.rts-rate-btn:focus-visible {
    outline: 3px solid var(--rts-black);
    outline-offset: 3px;
}

.rts-rate-icon {
    font-size: 18px;
    line-height: 1;
}

.rts-rate-skip {
    border: none;
    background: transparent;
    color: var(--rts-gray-dark);
    text-decoration: underline;
    padding: 10px 12px;
}

.rts-rate-skip:hover {
    color: var(--rts-black);
}

/* Helpful button */
.rts-btn-helpful {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--rts-black);
    border: 2px solid var(--rts-gray-light);
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

.rts-btn-helpful:hover {
    background: var(--rts-cream);
    border-color: var(--rts-gray-mid);
}

.rts-btn-helpful:focus-visible {
    outline: 3px solid var(--rts-black);
    outline-offset: 3px;
}

.rts-btn-helpful.rts-helped {
    background: var(--rts-black);
    color: var(--rts-white);
    border-color: var(--rts-black);
    cursor: default;
}

.rts-btn-helpful svg {
    width: 18px;
    height: 18px;
}

/* Helpful toast */
.rts-helpful-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--rts-black);
    color: var(--rts-white);
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px var(--rts-shadow-strong);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.rts-helpful-toast.rts-toast-show {
    transform: translateX(-50%) translateY(0);
}

/* ==========================================
   SHARE SECTION
   ========================================== */

.rts-letter-share {
    text-align: center;
    padding: 50px 0px 0px 0px;
}

.rts-share-label {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Special Elite', sans-serif;
    color: var(--rts-black);
    margin-bottom: 20px;
}

.rts-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.rts-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    gap: 10px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: #111827;
    color: #ffffff;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.rts-share-btn:hover {
    color: #FCA311;
    background: #070C13 !important;
    
}

.rts-share-btn:focus {
    outline: none;
}

.rts-share-btn:focus-visible {
    outline: 3px solid var(--rts-black);
    outline-offset: 3px;
}

.rts-share-btn i {
    font-size: 18px;
}

/* ==========================================
   ONBOARDING MODAL
   ========================================== */

/* 50% transparency overlay */
.rts-onboarding-overlay {
    position: fixed!important;
    inset: 0!important;
    background: rgba(0,0,0,0.5)!important;
    /* Default hidden. JS toggles display to flex when onboarding is active. */
    display: none;
    align-items: center!important;
    justify-content: center!important;
    /* Belt-and-braces: stay above any fixed widgets */
    z-index: 2147483647!important;
    padding: 16px!important;
    overscroll-behavior: contain!important;
    -webkit-overflow-scrolling: touch;
}

html.rts-onboarding-active #rts-quick-exit-wrap,
html.rts-onboarding-active .rts-a11y-pill,
html.rts-onboarding-active .rts-a11y-panel{
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1 !important;
    display: none !important;
}


/*
  IMPORTANT:
  The overlay uses display:flex!important by default.
  When JS hides it, we must win the specificity battle.
*/
.rts-onboarding-overlay.rts-hidden-force{
    display:none !important;
    visibility:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
}

.rts-onboarding-modal {
    background: var(--rts-white)!important;
    max-width: 900px !important;
    width: 100%!important;
    border-radius: 8px!important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3)!important;
    position: relative!important;
    overflow: visible !important; 
}


/* Topbar (contains Skip button) */
.rts-onboarding-topbar{
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 18px 0;
    background: transparent;
}

.rts-btn-skip{
    appearance: none;
    border: 2px solid #D63031;
    background: #D63031;
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rts-btn-skip:hover{
    background: #000;
    border-color: #000;
}

.rts-btn-skip:active{
    transform: none;
}

.rts-btn-skip:focus-visible{
    outline: 3px solid #FCA311;
    outline-offset: 2px;
}

/* Legacy side-tag: keep defined but hide by default (markup no longer outputs it). */
.rts-skip-tag{ display:none !important; }

/* New inner wrapper for scrolling content */
.rts-onboarding-scroll-wrapper {
    max-height: 80vh;
    overflow-y: auto;
    width: 100%;
    border-radius: 8px; /* Match modal */
    background: var(--rts-white); /* Ensure bg matches */
}

.rts-onboarding-content {
    padding: 50px 60px!important;
}

.rts-onboarding-content h2 {
    font-size: 32px!important;
    color: var(--rts-black)!important;
    margin-bottom: 12px!important;
    line-height: 1.3!important;
}

.rts-onboarding-content > p {
    color: var(--rts-gray-mid)!important;
    margin-bottom: 40px!important;
    font-size: 16px!important;
}

.rts-onboarding-step h3 {
    font-size: 24px!important;
    color: var(--rts-black)!important;
    margin-bottom: 10px!important;
}

.rts-step-subtitle {
    font-size: 14px!important;
    color: var(--rts-gray-mid)!important;
    margin-bottom: 25px!important;
}

/* Checkbox group - 2 columns on larger screens */
.rts-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.rts-checkbox-label {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border: 2px solid var(--rts-gray-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rts-checkbox-label:hover {
    background: var(--rts-cream);
    border-color: var(--rts-gray-mid);
}

.rts-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.rts-checkbox-label:has(input:checked) {
    color: var(--rts-black);
}

/* Radio group */
.rts-radio-group {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.rts-radio-label {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border: 2px solid var(--rts-gray-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rts-radio-label:hover {
    background: var(--rts-cream);
    border-color: var(--rts-gray-mid);
}

.rts-radio-label input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
}

.rts-radio-label:has(input:checked) {
    background: var(--rts-black);
    color: var(--rts-white);
    border-color: var(--rts-black);
}

/* Prominent Exit/Skip Tag */
.rts-skip-tag {
    position: absolute;
    top: 30px;
    right: -45px; /* Hanging off the side */
    width: 45px;
    min-height: 120px;
    background-color: #d63031; /* Urgent/Visible Red */
    color: #fff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 1001; /* Above modal content */
    box-shadow: 4px 0 15px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.2);
    border-left: none;
    transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 20px 0;
    letter-spacing: 1px;
}

.rts-skip-tag:hover {
    right: -55px; /* Slide out slightly on hover */
    background-color: #e17055;
}

.rts-skip-tag:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

/* ==========================================
   SUBMIT FORM
   ========================================== */

.rts-submit-form-wrapper {
    width: 100%;
    padding: 0;
}

.rts-form {
    background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 20%, rgba(255, 255, 255, 0.6) 100%) !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    box-shadow: 
        inset 0 0 80px rgba(160, 140, 100, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1),            
        0 20px 40px -10px rgba(0, 0, 0, 0.1) !important;
    border-radius: 2px !important;
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 0px;
    padding:50px;
}

.rts-form:before {
    content: "";
    position: absolute;
    top: -15px;
    left: 50%;       
    transform: translateX(-50%) rotate(1deg); 
    width: 120px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 10;
}

.rts-form-intro {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--rts-cream);
    border-left: 4px solid var(--rts-black);
    font-size: 15px;
    line-height: 1.6;
}

.rts-form-intro p {
    margin-bottom: 10px;
}

.rts-form-intro p:last-child {
    margin-bottom: 0;
}

.rts-form-field {
    margin-bottom: 25px;
}

.rts-form-field label {
    display: block;
    font-weight: 600;
    color: var(--rts-black);
    margin-bottom: 8px;
    font-size: 16px;
}

.rts-optional,
.rts-required {
    font-weight: 400;
    font-size: 14px;
    color: var(--rts-gray-mid);
}

.rts-form-field input[type="text"],
.rts-form-field input[type="email"],
.rts-form-field textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--rts-gray-light);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    color: var(--rts-black);
    background: var(--rts-white);
    transition: all 0.2s ease;
}

.rts-form-field input:focus,
.rts-form-field textarea:focus {
    outline: none;
    border-color: var(--rts-black);
    box-shadow: 0 0 0 3px rgba(26,26,26,0.1);
}

.rts-form-field textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

.rts-char-count {
    display: block;
    font-size: 13px;
    color: var(--rts-gray-mid);
}

.rts-field-help {
    display: block;
    font-size: 13px;
    color: var(--rts-gray-mid);
    margin-top: 6px;
}

/* Checkbox field */
.rts-checkbox-field .rts-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.rts-checkbox-field input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Form actions */
.rts-form-actions {
    margin-top: 30px;
}

.rts-btn-submit {
    width: 100%;
    position: relative;
}

.rts-btn-spinner {
    display: none;
}

/* Form response */
.rts-form-response {
    margin-top: 20px;
}

.rts-error {
    padding: 15px;
    background: #ffebee;
    border-left: 4px solid #d32f2f;
    color: #c62828;
    font-size: 15px;
}

/* Success message */
.rts-submit-success {
    text-align: center;
    padding: 60px 40px;
    background: var(--rts-white);
    border-radius: 2px;
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.26),
        0 4px 8px rgba(0,0,0,0.24);
}

.rts-success-icon {
    width: 80px;
    height: 80px;
    background: #2e7d32;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
}

.rts-submit-success h3 {
    font-size: 28px;
    color: var(--rts-black);
    margin-bottom: 15px;
}

.rts-submit-success p {
    font-size: 16px;
    color: var(--rts-gray-mid);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .rts-letter-card {
        /* Keep room for the top-left tag icons */
        padding: 52px 20px 26px;
    }

    .rts-tag-btn i {
        font-size: 13px;
    }
    
    .rts-tag-btn{
        width: 25px;
        height: 25px;
    }
    .rts-letter-top-tags{
        top: 12px;
        left: auto;
        right: 12px;
        flex-direction: row;
    }

    .rts-stat{
        min-width: 100%;
    }
    
    .rts-form {
        padding: 30px 20px;
    }
    
    .rts-onboarding-content {
        padding: 30px 20px;
    }
    
    .rts-onboarding-content h2 {
        font-size: 24px;
    }
    
    .rts-onboarding-step h3 {
        font-size: 20px;
    }
    
    /* Single column for checkboxes on mobile */
    .rts-checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .rts-letter-actions {
        flex-direction: column;
    }
    
    .rts-btn-helpful {
        width: 100%;
    }
    
    .rts-letter-content p {
    margin-bottom: 1.2em;
    font-size: 1rem;
    line-height: 1.5rem;
    }
    
    .rts-share-buttons {
        gap: 10px;
    }
    
    .rts-share-btn {
        font-size: 14px;
        padding: 10px 16px;
    }

    /* Mobile: keep modal tidy and keep Skip button compact */
    .rts-onboarding-overlay{ padding: 10px!important; }
    .rts-onboarding-modal{ border-radius: 14px!important; }
    .rts-onboarding-topbar{ padding: 12px 12px 0; }
    .rts-btn-skip{ font-size: 13px; padding: 9px 12px; border-radius: 10px; }
    .rts-onboarding-content{ padding: 22px 16px; }
    .rts-onboarding-content h2{ font-size: 22px; }
    .rts-onboarding-step h3{ font-size: 18px; }
}

/* ==========================================
   ACCESSIBILITY: REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =========================================
   FEEDBACK MODAL (SUBTLE)
   ========================================= */
.rts-letter-feedback-link {
    max-width: 100%;
    width: 100%;
    margin: 0px;
    padding: 25px 0px !important;
    text-align: left;
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
}
.rts-feedback-open,
.rts-trigger-open {
    appearance: none;
    background: #000000 !important;
    color: #ffffff;
    border: 0;
    font-family: 'Special Elite', 'Courier New', monospace;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease;
}
.rts-feedback-open:hover,
.rts-trigger-open:hover {
    background: #FCA311 !important;
    color: #000000 !important;
}
.rts-feedback-open:focus-visible,
.rts-trigger-open:focus-visible {
    outline: 3px solid var(--rts-blue);
    outline-offset: 3px;
    border-radius: 8px;
}

.rts-modal{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}
.rts-modal[aria-hidden="false"]{ display:block; }
.rts-modal-backdrop{
    position:absolute;
    inset:0;
    background: rgba(0,0,0,0.55);
}
.rts-modal-panel{
    position: relative;
    width: min(640px, calc(100% - 24px));
    height:fit-content;
    margin: 10vh auto 0;
    background: var(--rts-white);
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 18px 18px 16px;
}
.rts-modal-header{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.rts-modal-header h3{
    margin:0;
    font-size: 1.2rem;
    line-height: 1.2;
}
.rts-modal-close{
    appearance:none;
    border:0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor:pointer;
    color: var(--rts-black);
    padding: 4px 8px;
    border-radius: 12px;
}
.rts-modal-close:focus-visible{
    outline: 3px solid var(--rts-blue);
    outline-offset: 3px;
}
.rts-field{ margin: 10px 0; text-align:left; }
.rts-field label{ display:block; font-weight:700; margin-bottom:6px; }
.rts-field-inline{
    display:flex;
    align-items:flex-start;
    gap:10px;
}
.rts-field-inline label{ margin:0; font-weight:700; }
.rts-field input[type="email"],
.rts-field select,
.rts-field textarea{
    width:100%;
    border:2px solid rgba(0,0,0,0.18);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 1rem;
    background: var(--rts-white);
}
.rts-field textarea{ resize: vertical; min-height: 110px; }
.rts-field input:focus-visible,
.rts-field select:focus-visible,
.rts-field textarea:focus-visible{
    outline: 3px solid var(--rts-blue);
    outline-offset: 2px;
}
.rts-actions{
    display:flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}
.rts-muted{
    margin-top: 10px;
    font-size: 0.88rem;
    color: rgba(0,0,0,0.68);
}

body.rts-modal-open{overflow:hidden;}

/* =========================================
   SUBMIT PAGE (WRITE A LETTER) LAYOUT
   2fr / 1fr grid with branded instructions panel
   ========================================= */

.rts-submit-grid{
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
    width: 100%;
}

.rts-submit-instructions{
    background: #182437;
    color: #F1E3D3;
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.10);
}

.rts-submit-instructions h3{
    margin: 0 0 12px;
    color: #FCA311;
    font-size: 1.35rem;
    line-height: 1.15;
}

.rts-instruction-block{
  border-top: 1px solid rgba(241,227,211,0.18);
  padding-top: 14px;
  margin-top: 14px;
}

/* Buttons */
.rts-btn:focus-visible{outline:3px solid rgba(252,163,17,.55);outline-offset:3px}
.rts-btn-next{background:#F1E3D3; border: none; color:#000000; min-width:200px; text-align:center}
.rts-btn-next:hover,.rts-btn-next:focus{background:#FCA311;color:#000}
.rts-submit-btn{background:#070C13;border-color:#070C13;color:#fff;padding:12px 22px;border-radius:10px}
.rts-submit-btn:hover,.rts-submit-btn:focus{background:#FCA311;border-color:#FCA311;color:#000}

/* Footer button placement */
.rts-letter-card-footer{display:flex;justify-content:flex-end;margin-top:26px}

/* Write a letter layout */
.rts-submit-grid{display:grid;grid-template-columns:1.25fr .9fr;gap:28px;align-items:start}
.rts-submit-form{display:flex;flex-direction:column;gap:14px}
.rts-submit-form .rts-field{display:flex;flex-direction:column;gap:6px}
.rts-consent-row{display:flex;align-items:flex-start;gap:10px}
.rts-submit-actions{display:flex;justify-content:flex-end;margin-top:10px}
.rts-submit-actions .rts-submit-btn{min-width:180px}

@media (max-width:900px){.rts-submit-grid{grid-template-columns:1fr}}
@media (max-width:768px){.rts-letter-card-footer{justify-content:stretch}.rts-btn-next{width:100%;min-width:0}.rts-submit-actions{justify-content:stretch}.rts-submit-actions .rts-submit-btn{width:100%;min-width:0}}

/* =========================================================
   RTS Letter Viewer Layout Clean-up (Hotfix)
   ========================================================= */

.rts-letter-card{
  position: relative;
}

.rts-letter-body{
  width:100%;
}


@media (max-width: 767px){
  .rts-letter-footer .rts-btn-next{
    width:100%;
    justify-content:center;
  }
}

/* Rating prompt stays hidden until JS reveals it */


/* =========================================================
   Letter viewer refinements - tabs, padding, footer
   ========================================================= */

@media (max-width: 768px){
  .rts-letter-content{
    padding: 28px 18px 22px;
  }
}


@media (max-width: 768px){
  .rts-letter-footer{
    justify-content: stretch;
  }
  .rts-letter-footer .rts-btn-next{
    width: 100%;
    max-width: none;
  }
}

/* Rating prompt stays hidden until JS reveals it */
.rts-rate-prompt[hidden]{ display:none !important; }

/* (Removed legacy icon tab styles; viewer now uses text Feedback tab only) */

/* Make sure old feedback link block can't reappear */
.rts-letter-feedback-link{ display:none !important; }


/* =========================================================
   HOTFIX: Viewer feedback/report UI changes
   - Letter font: Special Elite (client request)
   - Report: text link left of "Read Another Letter"
   - Feedback: slim vertical tab (desktop), top tab (mobile)
   ========================================================= */

.rts-letter-content,
.rts-letter-body{
  font-family: 'Special Elite', sans-serif;
}

/* Report text link (no button styling) */
.rts-report-link{
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin-left: auto !important; /* Pushes this element to the right */
  margin-right: 30px !important;
  font-family: 'Special Elite', sans-serif;
  font-size: 0.9rem;
  color: #000000;
  cursor: pointer;
  text-decoration: none;
}

.rts-report-link:hover,
.rts-report-link:focus-visible{
  text-decoration: underline;
}

.rts-report-link:focus-visible{
  outline: 3px solid #FCA311;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Feedback tab wrapper (desktop): outside the letter */
.rts-letter-tabs{
  position: absolute;
  z-index: 6;
  top: -50px;
  left: -22px;
  transform: translateY(-50%);
}

/* Feedback tab (desktop): slim vertical text tab */
.rts-feedback-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: #F1E3D3 !important;
  color: #000000 !important;
  border: 0;
  font-family: 'Special Elite', sans-serif;
  font-size: 0.85rem;
  line-height: 1;
  padding: 15px 7px;
  cursor: pointer;
  border-radius: 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.02em;
}

.rts-feedback-tab:hover,
.rts-feedback-tab:focus-visible{
  background: #000000 !important;
  color: #FFFFFF !important;
}

.rts-feedback-tab:focus-visible{
  outline: 3px solid #FCA311;
  outline-offset: 3px;
}

/* Mobile: move Feedback tab inside top-right and make horizontal + slim */
@media (max-width: 768px){
  .rts-letter-tabs{
    top: -150px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: max-content;
  }
  .rts-feedback-tab{
    writing-mode: horizontal-tb;
    text-orientation: initial;
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}
/* =========================================================
   Feedback tab rendering fixes
   - Keep the tab visible as a "tag" that protrudes from the card
   - Avoid z-index conflicts introduced by earlier experiments
   ========================================================= */

.rts-letter-card{ overflow: visible; }
.rts-letter-tabs{ z-index: 10; }
.rts-feedback-tab{ z-index: 11; }

/* =========================================================
   Hotfix: remove stray pseudo-element artifact under letter card
   (Seen as .rts-letter-card::after with empty 8px height)
   ========================================================= */
.rts-letter-card::after{
  content: none !important;
  display: none !important;
}


/* ==========================================
   ONBOARDING MOBILE TIGHTENING (Touch + Small Screens)
   ========================================== */
@media (max-width: 665px) {
  .rts-onboarding-overlay{
    align-items: flex-start !important;
    padding: 10px !important;
    overflow-y: auto !important;
  }

  .rts-onboarding-modal{
    max-height: calc(100vh - 60px) !important;
    overflow: auto !important;
    border-radius: 10px !important;
  }

  .rts-onboarding-topbar{
    padding: 12px 12px 0 !important;
  }

  .rts-onboarding-content{
    padding: 35px 25px 25px !important;
    gap: 14px !important;
  }

  .rts-onboarding-title{
    font-size: 44px !important;
    line-height: 1.0 !important;
    margin: 0 0 10px !important;
  }

  .rts-onboarding-subtitle{
    font-size: 16px !important;
    line-height: 1.35 !important;
    margin: 0 0 12px !important;
  }

  .rts-onboarding-question{
    font-size: 34px !important;
    line-height: 1.05 !important;
    margin: 16px 0 8px !important;
  }

  .rts-onboarding-hint{
    font-size: 14px !important;
    margin-bottom: 10px !important;
  }

  .rts-onboarding-options{
    gap: 10px !important;
    padding-bottom: 6px !important;
  }

  .rts-onboarding-option{
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }

  .rts-onboarding-option label{
    gap: 10px !important;
    font-size: 16px !important;
  }

  .rts-onboarding-actions{
    position: sticky !important;
    bottom: 0 !important;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(4px);
    padding: 10px 0 0 !important;
    margin-top: 12px !important;
  }

  .rts-btn-next-step,
  .rts-btn-complete{
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }

  .rts-btn-skip{
    padding: 10px 14px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }
}

/* Ensure onboarding remains tappable above everything */
.rts-onboarding-overlay,
.rts-onboarding-modal{
  pointer-events: auto !important;
}


/* ==========================================
   ONBOARDING: ensure overlay is the only interactive layer (iOS fix)
   ========================================== */
html.rts-onboarding-active body > *:not(.rts-onboarding-overlay) {
    pointer-events: none !important;
}
html.rts-onboarding-active .rts-onboarding-overlay {
    pointer-events: auto !important;
}

/* Mobile: hide floating feedback tab button (it crowds the top) */
@media (max-width: 768px) {
    .rts-letter-tabs { display: none !important; }
}

/* Mobile: onboarding should feel like a full-screen sheet (easy to tap, no cramped scroll)
   - Full viewport height
   - 35px brand radius
   - Cream pill hover/focus states for options
*/
@media (max-width: 640px) {
    .rts-onboarding-overlay { padding: 10px !important; }
    .rts-onboarding-modal {
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 60px) !important;
        max-height: calc(100vh - 60px) !important;
        border-radius: 35px !important;
        overflow: hidden !important;
    }
    .rts-onboarding-scroll-wrapper {
        max-height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .rts-onboarding-topbar { padding: 12px 14px 0 !important; }
    .rts-onboarding-content { padding: 35px 25px 25px !important; }
    .rts-onboarding-content h1,
    .rts-onboarding-content h2 { font-size: 1.6rem !important; line-height: 1.2 !important; margin-bottom: 10px !important; }
    .rts-onboarding-content p { font-size: 1rem !important; line-height: 1.35 !important; margin-bottom: 10px !important; }
    .rts-onboarding-options { gap: 10px !important; }
    .rts-onboarding-actions {
        position: sticky !important;
        bottom: 0 !important;
        background: #fff !important;
        padding-top: 10px !important;
        padding-bottom: calc(env(safe-area-inset-bottom) + 10px) !important;
    }
    .rts-onboarding-option:hover,
    .rts-onboarding-option:focus-within {
        background: #f6efe3 !important;
        border-radius: 999px !important;
    }
}


/* ==========================================
   ONBOARDING (Redesign)
   ========================================== */

/* Overlay */
.rts-onboarding-overlay{
    position: fixed;
    inset: 0;
    background: rgba(26,26,26,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999999;
}

/* Modal container */
.rts-onboarding-modal{
    background: linear-gradient(135deg, #FFFFFF 0%, #F1E3D3 120%);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(252, 163, 17, 0.05) 0%, transparent 20%);
    border-radius: 35px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 680px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    font-family: 'Inter', sans-serif;
}

.rts-onboarding-modal::before{
    content:'';
    position:absolute;
    top:0; left:0; right:0;
    height:4px;
    background: linear-gradient(90deg, #FCA311, #FFE5B4);
    border-radius: 35px 35px 0 0;
    z-index: 25;
    pointer-events:none;
}

/* Skip container + button */
.rts-skip-container{
    flex-shrink: 0;
    z-index: 20;
    background: transparent;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 35px 22px 0;
}

.rts-btn-skip{
    background-color:#D63031;
    color:#FFFFFF;
    font-weight:700;
    font-size:12px;
    letter-spacing:0.15em;
    text-transform:uppercase;
    border:none;
    cursor:pointer;
    border-radius: 10px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    display:flex;
    align-items:center;
    justify-content:center;
    white-space:nowrap;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
}

.rts-btn-skip:hover{
    background-color:#000;
    transform: none;
}

/* Skip must not animate/rotate on click or focus */
.rts-btn-skip:active,
.rts-btn-skip:focus,
.rts-btn-skip:focus-visible{
    transform: none !important;
    animation: none !important;
}

@media (min-width:768px){
    .rts-btn-skip{
        writing-mode: horizontal-tb;
        text-orientation: initial;
        transform: none;
        width: 200px;
        height: auto;
        border-radius: 10px;
        display: block;
        text-align: center;
        white-space: nowrap;
    }
}

/* Scroll wrapper */
.rts-onboarding-scroll-wrapper{
    flex-grow: 1;
    order: 2;
    overflow-y:auto;
    scrollbar-width: thin;
    scrollbar-color:#E5E7EB transparent;
    scroll-behavior:smooth;
    border-radius: 0 0 35px 35px;
}
.rts-onboarding-scroll-wrapper::-webkit-scrollbar{ width:6px; }
.rts-onboarding-scroll-wrapper::-webkit-scrollbar-track{ background:transparent; }
.rts-onboarding-scroll-wrapper::-webkit-scrollbar-thumb{ background-color:#E5E7EB; border-radius:20px; }

.rts-onboarding-content{
    padding:35px;
}
.rts-onboarding-content > * + *{ margin-top:1.5rem; }

/* Typography */
#rts-onboarding-title{
    font-family: 'Special Elite', serif;
    font-size:2.25rem;
    line-height:1.1;
    font-weight:700;
    color:#1A1A1A;
    margin:0 0 1rem 0;
    position:relative;
}
#rts-onboarding-title::after{
    content:'';
    display:block;
    width:60px;
    height:3px;
    background:#FCA311;
    margin:0.75rem 0;
}
#rts-onboarding-desc{
    color:#4B5563;
    font-size:1.05rem;
    line-height:1.5;
    margin-bottom:1.5rem;
}

.rts-onboarding-step{
    animation: rtsFadeIn 0.4s ease-out;
}
@keyframes rtsFadeIn{
    from{ opacity:0.7; transform: translateY(10px); }
    to{ opacity:1; transform: translateY(0); }
}

.rts-onboarding-step h3{
    font-size:0.8rem;
    font-weight:700;
    color:#4B5563;
    margin-bottom:1rem;
}
.rts-onboarding-step[data-step="2"] h3,
.rts-onboarding-step[data-step="3"] h3{
    font-family: var( --e-global-typography-primary-font-family ), Sans-serif;
    font-size:1.5rem;
    text-transform:none;
    letter-spacing:normal;
    color:#1A1A1A;
    margin-bottom:1.5rem;
}

.rts-step-subtitle{
    font-size:0.75rem;
    color:#9CA3AF;
    margin-top:-0.75rem;
    margin-bottom:1rem;
    font-style:italic;
}

/* Inputs */
.rts-checkbox-group,
.rts-radio-group{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-bottom:2rem;
}
.rts-checkbox-group{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}
.rts-checkbox-label,
.rts-radio-label{
    display:flex;
    align-items:center;
    padding:12px 16px;
    border:1px solid #E5E7EB;
    background:#FFFFFF;
    border-radius:6px;
    cursor:pointer;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    position:relative;
    user-select:none;
    transform-origin:center;
}

.rts-checkbox-label:hover,
.rts-radio-label:hover{
    border-color:#9CA3AF;
    background-color:#F1E3D3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.rts-checkbox-label:focus-within,
.rts-radio-label:focus-within{
    border-color:#1A1A1A;
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #1A1A1A;
    z-index:10;
}

/* Selected styling (JS also toggles .selected for older browsers) */
.rts-checkbox-label.selected,
.rts-radio-label.selected{
    background-color:#1A1A1A;
    border-color:#1A1A1A;
    color:#FFFFFF;
}
.rts-checkbox-label input,
.rts-radio-label input{
    position:absolute;
    opacity:0;
    cursor:pointer;
    height:0;
    width:0;
}
.rts-checkbox-label span::before,
.rts-radio-label span::before{
    content:'';
    display:inline-block;
    width:18px;
    height:18px;
    border:2px solid #D1D5DB;
    margin-right:12px;
    vertical-align:middle;
    background:#fff;
    transition: all 0.2s;
    flex-shrink:0;
}
.rts-checkbox-label span::before{ border-radius:4px; }
.rts-radio-label span::before{ border-radius:50%; }

.rts-checkbox-label.selected span::before,
.rts-radio-label.selected span::before{
    background-color:transparent;
    border-color:#FFFFFF;
}
.rts-checkbox-label.selected span::after{
    content:'✓';
    position:absolute;
    left:19px;
    color:#fff;
    font-weight:700;
    font-size:12px;
}
.rts-radio-label.selected span::after{
    content:'';
    position:absolute;
    left:21px;
    top:50%;
    transform: translateY(-50%);
    width:8px;
    height:8px;
    background:#fff;
    border-radius:50%;
}

/* Buttons */
.rts-btn{
    background-color:#1A1A1A;
    color:#F1E3D3;
    padding:12px 28px;
    border-radius:6px;
    font-weight:600;
    border:1px solid #1A1A1A;
    font-size:15px;
    cursor:pointer;
    min-width:120px;
    display:inline-flex;
    justify-content:center;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.rts-btn:hover{
    background-color:#000000;
    color:#ffffff;
}
.rts-btn:active{ transform: scale(0.98); }

.rts-btn-complete{
    background: linear-gradient(135deg, #FCA311, #e5940e);
    color:#1A1A1A;
    border:none;
    letter-spacing:0.5px;
    padding:14px 32px;
    box-shadow: 0 4px 16px rgba(252,163,17,0.3);
}
.rts-btn-complete:hover{
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252,163,17,0.4);
    background: linear-gradient(135deg, #e5940e, #FCA311);
}

/* Footer + progress dots */
.rts-step-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:10px;
    padding-top:15px;
    border-top:1px solid #eee;
}

.rts-progress-dots{ display:flex; gap:8px; }
.rts-dot{
    width:8px;
    height:8px;
    background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
    border-radius:50%;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.rts-dot.active{
    width:28px;
    background: linear-gradient(135deg, #1A1A1A, #374151);
    border-radius:4px;
    box-shadow: 0 2px 8px rgba(26,26,26,0.2);
}

/* Focus visible */
.rts-onboarding-modal :focus-visible{
    outline: 3px solid #FCA311;
    outline-offset:2px;
}

/* Mobile */
@media (max-width:767px){
    .rts-onboarding-modal{
        flex-direction:column;
        margin: max(20px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
        border-radius:24px;
    }
    .rts-skip-container{
        width:100%;
        order:0;
        display:flex;
        justify-content:center;
        background:transparent;
    }
    .rts-btn-skip{
        width:100%;
        height:auto;
        padding:10px 0;
        writing-mode: horizontal-tb;
        transform:none;
        font-size:11px;
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .rts-btn-skip::before{
        content:'↗';
        margin-right:8px;
        font-size:14px;
        display:inline-block;
    }
    .rts-onboarding-content{ padding:24px; }
    .rts-checkbox-group{ grid-template-columns:1fr; }
    #rts-onboarding-title{ font-size:1.5rem; }
    .rts-step-footer{
        flex-direction:column-reverse;
        gap:15px;
    }
    /* Keep onboarding buttons from forcing full-width */
    .rts-step-footer .rts-btn{ width:auto; }
}


/* =========================================================
   SUBMIT FORM (Write a Letter) - Consolidated from shortcode
   Moved from inline <style> in inc/shortcodes.php
   ========================================================= */

.rts-submit-form-wrapper{width:100%;box-sizing:border-box;padding:10px 0;}

/* Override the earlier .rts-submit-grid to match the shortcode layout */
.rts-submit-grid{display:grid;grid-template-columns:1fr 360px;gap:30px;align-items:start;}
@media(max-width:980px){.rts-submit-grid{grid-template-columns:1fr;}.rts-submit-instructions{order:-1;}}

.rts-form-header{margin-bottom:18px;}
.rts-title{margin:0 0 6px 0;font-family:'Special Elite',ui-monospace,monospace;font-size:2.2rem;letter-spacing:0.02em;}
.rts-subtitle{margin:0;color:#4b5563;line-height:1.5;font-size:1rem;}
.rts-field{margin-top:18px;}
.rts-field label{display:block;font-weight:600;margin-bottom:8px;color:#111827;}
.rts-optional{font-weight:400;color:#6b7280;font-size:0.9rem;}
.rts-required{color:#FCA311;font-weight:800;margin-left:4px;}
.rts-field input[type="text"],.rts-field input[type="email"],.rts-field textarea{width:100%;box-sizing:border-box;border:1px solid #e5e7eb;border-radius:10px;padding:12px 14px;font-size:1rem;outline:none;transition:border-color .2s ease,box-shadow .2s ease;}
.rts-field textarea{resize:vertical;min-height:220px;}
.rts-field input:focus,.rts-field textarea:focus{border-color:#111827;box-shadow:0 0 0 3px rgba(252,163,17,0.22);}
.rts-help-text{display:inline-flex;margin-top:8px;color:#6b7280;font-size:.9rem;align-items:center;flex-direction:row;flex-wrap:nowrap;gap:10px;}
.rts-honeypot{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;}
.rts-consent-field{margin-top:16px;}
.rts-consent-label{display:flex;gap:12px;align-items:flex-start;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:12px 14px;}
.rts-consent-label input{margin-top:2px;width:18px;height:18px;}
.rts-consent-label span{color:#111827;font-weight:600;line-height:1.35;}
.rts-form .rts-btn{margin-top:22px;width:auto;border:none;border-radius:12px;padding:14px 16px;font-size:1.05rem;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,background .15s ease;}
.rts-btn-primary{background:#111827;color:#fff;font-family:'Special Elite',ui-monospace,monospace;letter-spacing:0.03em;}
.rts-btn-primary:hover{transform:translateY(-1px);box-shadow:0 10px 18px rgba(0,0,0,0.16);}
.rts-btn-primary:disabled{opacity:.65;cursor:not-allowed;transform:none;box-shadow:none;}
.rts-form-message{margin-top:14px;font-size:0.98rem;}
.rts-form-message.success{color:#065f46;}
.rts-form-message.error{color:#b91c1c;}

/* Success box */
.rts-submit-success{margin-top:18px;border:1px solid #e5e7eb;border-radius:16px;padding:16px 16px 14px 16px;background:linear-gradient(180deg,#ffffff,#fff7ea);}
.rts-success-title{margin:0 0 8px 0;font-family:'Special Elite',ui-monospace,monospace;font-size:1.35rem;color:#111827;}
.rts-success-text{margin:0 0 10px 0;color:#374151;line-height:1.55;font-size:1rem;}
.rts-success-share{margin-top:10px;padding-top:12px;border-top:1px solid rgba(17,24,39,0.10);}
.rts-share-buttons{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px;}
.rts-share-btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 12px;border-radius:12px;text-decoration:none;font-weight:700;font-size:0.95rem;border:1px solid rgba(17,24,39,0.12);background:#111827;color:#ffffff;transition:transform .15s ease,box-shadow .15s ease,background .15s ease;}
.rts-share-btn:hover{transform:translateY(-1px);box-shadow:0 10px 18px rgba(0,0,0,0.12);background:#0b1220;}
.rts-share-btn:focus{outline:none;box-shadow:0 0 0 3px rgba(252,163,17,0.28);}

/* Instructions sidebar */
.rts-submit-instructions{background:#0f1b2d;border-radius:28px;padding:26px;box-shadow:0 10px 30px rgba(0,0,0,0.10);border:1px solid rgba(255,255,255,0.06);}
.rts-submit-instructions h3{margin:0;font-family:'Special Elite',ui-monospace,monospace;font-size:1.55rem;color:#fff;letter-spacing:0.04em;}
.rts-instructions-divider{height:1px;background:linear-gradient(90deg,rgba(252,163,17,0.7),rgba(255,255,255,0.08));margin:14px 0 18px 0;}
.rts-guideline + .rts-guideline{margin-top:18px;padding-top:18px;border-top:1px solid rgba(255,255,255,0.08);}
.rts-guideline-title{display:flex;gap:10px;align-items:center;font-family:'Special Elite',ui-monospace,monospace;font-size:1.15rem;color:#FCA311;margin:0 0 8px 0;}
.rts-guideline-text{color:rgba(255,255,255,0.88);line-height:1.55;font-size:0.98rem;}
.rts-emoji{font-size:1.1rem;line-height:1;}

/* ============================================
   SKELETON LOADING (Perceived Performance)
   Shows a shimmer placeholder while the letter
   is being fetched over the network.
   ============================================ */
@keyframes rts-shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}
.rts-skeleton{animation:rts-shimmer 1.6s ease-in-out infinite;background:linear-gradient(90deg,rgba(255,255,255,0.04) 25%,rgba(255,255,255,0.10) 50%,rgba(255,255,255,0.04) 75%);background-size:800px 100%;border-radius:12px;}
.rts-skeleton-line{height:1em;margin-bottom:0.75em;border-radius:8px;}
.rts-skeleton-line:last-child{width:60%;}
.rts-skeleton-title{height:1.6em;width:45%;margin-bottom:1.2em;border-radius:10px;}
.rts-skeleton-block{padding:30px;display:flex;flex-direction:column;gap:0;}
