/* ============================================================
   RECATOOLS — Random Number Generator (RT-FUN-002)
   Tool-specific styles only. Global styles in tool-page.css.
   ============================================================ */

/* ----------------------------------------------------------
   MODE TABS (pill buttons)
---------------------------------------------------------- */

.rng-mode-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.rng-mode-tab {
    padding: 9px 20px;
    border: 2px solid #E2E4E8;
    border-radius: 999px;
    background: #fff;
    color: #64748B;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
}

.rng-mode-tab:hover {
    border-color: #E8472F;
    color: #E8472F;
}

.rng-mode-tab.active {
    background: #E8472F;
    border-color: #E8472F;
    color: #fff;
    box-shadow: 0 4px 12px rgba(232, 98, 42, 0.25);
}

/* ----------------------------------------------------------
   MODE PANELS
---------------------------------------------------------- */

.rng-mode-panel[hidden] {
    display: none;
}

/* ----------------------------------------------------------
   FORM ROW — label + input pairs
---------------------------------------------------------- */

.rng-field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.rng-field-row label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0D1B2A;
}

.rng-field-row .rng-hint {
    font-size: 0.775rem;
    color: #64748B;
    margin-top: -4px;
}

.rng-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rng-three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .rng-two-col,
    .rng-three-col {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------------
   INPUTS
---------------------------------------------------------- */

.rng-input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #E2E4E8;
    border-radius: 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    color: #0D1B2A;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

.rng-input:focus {
    outline: none;
    border-color: #E8472F;
    box-shadow: 0 0 0 3px rgba(232, 98, 42, 0.12);
}

.rng-input.rng-input-error {
    border-color: #d94040;
    box-shadow: 0 0 0 3px rgba(217, 64, 64, 0.12);
}

.rng-field-error {
    font-size: 0.8rem;
    color: #d94040;
    margin: 4px 0 0;
    font-weight: 500;
}

/* Textarea */
.rng-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #E2E4E8;
    border-radius: 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9375rem;
    color: #0D1B2A;
    background: #fff;
    resize: vertical;
    min-height: 140px;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

.rng-textarea:focus {
    outline: none;
    border-color: #E8472F;
    box-shadow: 0 0 0 3px rgba(232, 98, 42, 0.12);
}

.rng-textarea.rng-input-error {
    border-color: #d94040;
    box-shadow: 0 0 0 3px rgba(217, 64, 64, 0.12);
}

/* ----------------------------------------------------------
   TOGGLE SWITCH
---------------------------------------------------------- */

.rng-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rng-toggle-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0D1B2A;
    cursor: pointer;
}

.rng-toggle {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.rng-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.rng-toggle-track {
    position: absolute;
    inset: 0;
    background: #E2E4E8;
    border-radius: 999px;
    transition: background 0.2s;
    cursor: pointer;
}

.rng-toggle-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.rng-toggle input:checked + .rng-toggle-track {
    background: #E8472F;
}

.rng-toggle input:checked + .rng-toggle-track::after {
    transform: translateX(20px);
}

.rng-toggle input:focus-visible + .rng-toggle-track {
    box-shadow: 0 0 0 3px rgba(232, 98, 42, 0.25);
}

/* ----------------------------------------------------------
   RADIO OUTPUT FORMAT
---------------------------------------------------------- */

.rng-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.rng-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0D1B2A;
    cursor: pointer;
}

.rng-radio-option input[type="radio"] {
    accent-color: #E8472F;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ----------------------------------------------------------
   GENERATE BUTTON
---------------------------------------------------------- */

.rng-generate-btn {
    width: 100%;
    padding: 15px 24px;
    background: #E8472F;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    letter-spacing: 0.01em;
    margin-top: 8px;
}

.rng-generate-btn:hover {
    background: #d0541f;
    box-shadow: 0 6px 20px rgba(232, 98, 42, 0.35);
    transform: translateY(-1px);
}

.rng-generate-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ----------------------------------------------------------
   COPY ALL BUTTON (secondary)
---------------------------------------------------------- */

.rng-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #FFFFFF;
    border: 2px solid #E2E4E8;
    border-radius: 8px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0D1B2A;
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s;
}

.rng-copy-btn:hover {
    background: #eee;
    border-color: #ccc;
}

.rng-copy-btn.copied {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

/* ----------------------------------------------------------
   RESULT SECTION (Single mode)
---------------------------------------------------------- */

.rng-single-result-section {
    margin-top: 28px;
    text-align: center;
}

.rng-single-result-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    margin-bottom: 8px;
}

/* THE MASSIVE NUMBER DISPLAY */
#rng-single-result {
    font-family: 'IBM Plex Serif', serif;
    font-size: clamp(80px, 18vw, 144px);
    line-height: 1;
    color: #0D1B2A;
    font-weight: 400;
    letter-spacing: -0.02em;
    min-height: 1.1em;
    display: block;
    transition: opacity 0.1s;
    user-select: all;
    cursor: pointer;
}

#rng-single-result.rng-result-counting {
    color: #E8472F;
    opacity: 0.7;
}

/* Pop animation: brief scale burst when final number lands */
@keyframes rngPop {
    0%   { transform: scale(0.88); opacity: 0.5; }
    60%  { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

#rng-single-result.rng-result-pop {
    animation: rngPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.rng-single-range-display {
    font-size: 0.875rem;
    color: #64748B;
    margin-top: 10px;
}

/* ----------------------------------------------------------
   HISTORY PILLS (Single mode)
---------------------------------------------------------- */

.rng-history-section {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #E2E4E8;
}

.rng-history-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    margin-bottom: 10px;
}

.rng-history-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.rng-history-empty {
    font-size: 0.85rem;
    color: #aaa;
    font-style: italic;
}

.rng-history-pill {
    padding: 6px 14px;
    background: #FFFFFF;
    border: 2px solid #E2E4E8;
    border-radius: 999px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0D1B2A;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rng-history-pill:hover {
    background: #E8472F;
    border-color: #E8472F;
    color: #fff;
}

.rng-history-pill.copied {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

/* ----------------------------------------------------------
   OUTPUT TEXTAREA (Range + Sequence modes)
---------------------------------------------------------- */

.rng-output-area {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 2px solid #E2E4E8;
    border-radius: 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9375rem;
    color: #0D1B2A;
    background: #FFFFFF;
    resize: vertical;
    box-sizing: border-box;
    cursor: text;
}

.rng-output-stats {
    font-size: 0.8125rem;
    color: #64748B;
    margin-top: 6px;
    font-weight: 500;
}

.rng-output-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* ----------------------------------------------------------
   PICK FROM LIST — RESULT CARDS
---------------------------------------------------------- */

.rng-pick-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.rng-pick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #E2E4E8;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: border-color 0.18s, box-shadow 0.18s;
    animation: pickCardIn 0.25s ease forwards;
}

.rng-pick-card:hover {
    border-color: #E8472F;
    box-shadow: 0 4px 16px rgba(232, 98, 42, 0.12);
}

@keyframes pickCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rng-pick-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #E8472F;
    color: #fff;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rng-pick-item {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0D1B2A;
    word-break: break-word;
}

/* ----------------------------------------------------------
   PICK FROM LIST — NOTE
---------------------------------------------------------- */

.rng-pick-note {
    font-size: 0.825rem;
    color: #64748B;
    background: #FFFFFF;
    border: 1px solid #E2E4E8;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    line-height: 1.5;
}

.rng-pick-note strong {
    color: #0D1B2A;
}

/* ----------------------------------------------------------
   RESULT SECTION WRAPPER
---------------------------------------------------------- */

.rng-result-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #E2E4E8;
}

.rng-result-section-label {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    margin-bottom: 12px;
}

/* ----------------------------------------------------------
   HOW-TO STEPS
   (Supplement tool-page.css base styles)
---------------------------------------------------------- */

.how-to-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.how-to-step {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: #E8472F;
    color: #fff;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-body h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #0D1B2A;
}

.step-body p {
    margin: 0;
    font-size: 0.9375rem;
    color: #64748B;
    line-height: 1.65;
}

/* ----------------------------------------------------------
   EDUCATIONAL CONTENT
---------------------------------------------------------- */

.educational-content h3 {
    font-family: 'IBM Plex Serif', serif;
    font-size: 1.25rem;
    color: #0D1B2A;
    margin: 28px 0 10px;
}

.educational-content p {
    font-size: 0.9625rem;
    line-height: 1.8;
    color: #3a3834;
    margin-bottom: 14px;
}

.pull-quote {
    background: #FFFFFF;
    border-left: 4px solid #E8472F;
    border-radius: 0 10px 10px 0;
    padding: 18px 22px;
    margin: 24px 0;
}

.pull-quote p {
    font-family: 'IBM Plex Serif', serif;
    font-size: 1.125rem;
    color: #0D1B2A;
    font-style: italic;
    margin: 0;
    line-height: 1.6;
}

/* ----------------------------------------------------------
   FACT CARDS GRID (10 cards, 2-col)
---------------------------------------------------------- */

.fact-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .fact-cards-grid {
        grid-template-columns: 1fr;
    }
}

.fact-card {
    background: #fff;
    border: 1.5px solid #E2E4E8;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.18s, border-color 0.18s;
}

.fact-card:hover {
    border-color: #E8472F;
    box-shadow: 0 4px 16px rgba(232, 98, 42, 0.1);
}

.fact-num {
    font-family: 'IBM Plex Serif', serif;
    font-size: 1.5rem;
    color: #E8472F;
    font-weight: 400;
    line-height: 1;
}

.fact-card p {
    font-size: 0.9rem;
    color: #3a3834;
    line-height: 1.6;
    margin: 0;
}

/* ----------------------------------------------------------
   FAQ ACCORDION
---------------------------------------------------------- */

.faq-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: #fff;
    border: 1.5px solid #E2E4E8;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.18s;
}

.faq-item:has(.faq-question[aria-expanded="true"]) {
    border-color: #E8472F;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: none;
    border: none;
    text-align: left;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9625rem;
    font-weight: 600;
    color: #0D1B2A;
    cursor: pointer;
    gap: 12px;
}

.faq-question:hover {
    background: #fafaf8;
}

.faq-icon {
    font-size: 1.25rem;
    color: #E8472F;
    flex-shrink: 0;
    font-weight: 400;
    transition: transform 0.2s;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(0deg);
}

.faq-answer {
    padding: 0 20px 18px;
}

.faq-answer[hidden] {
    display: none;
}

.faq-answer p,
.faq-answer-inner {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #3a3834;
    margin: 0;
}

/* ----------------------------------------------------------
   RELATED TOOLS GRID
---------------------------------------------------------- */

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1.5px solid #E2E4E8;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
}

.related-tool-card:hover {
    border-color: #E8472F;
    box-shadow: 0 4px 18px rgba(232, 98, 42, 0.12);
    transform: translateY(-2px);
}

.related-tool-icon {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-radius: 12px;
    flex-shrink: 0;
}

.related-tool-info {
    flex: 1;
    min-width: 0;
}

.related-tool-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0D1B2A;
    margin: 0 0 2px;
}

.related-tool-desc {
    font-size: 0.8125rem;
    color: #64748B;
    line-height: 1.4;
    margin: 0;
}

.related-tool-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.related-tool-cat {
    font-size: 0.75rem;
    font-weight: 600;
    color: #E8472F;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.related-tool-cta {
    font-size: 0.875rem;
    font-weight: 700;
    color: #E8472F;
}

/* ----------------------------------------------------------
   NEWSLETTER (dark banner)
---------------------------------------------------------- */

.tool-newsletter {
    background: #0D1B2A;
    border-radius: 16px;
    padding: 36px 40px;
    margin: 40px 0;
    color: #fff;
}

.tool-newsletter h2 {
    font-family: 'IBM Plex Serif', serif;
    font-size: 1.625rem;
    color: #fff;
    margin: 0 0 8px;
}

.tool-newsletter p {
    font-size: 0.9375rem;
    color: #b0aca6;
    margin: 0 0 20px;
    line-height: 1.6;
}

.tool-newsletter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-newsletter-form input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #3a3834;
    border-radius: 10px;
    background: #2a2824;
    color: #fff;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9375rem;
}

.tool-newsletter-form input[type="email"]::placeholder {
    color: #64748B;
}

.tool-newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: #E8472F;
}

.tool-newsletter-form button {
    padding: 12px 22px;
    background: #E8472F;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
    white-space: nowrap;
}

.tool-newsletter-form button:hover {
    background: #d0541f;
}

.tool-newsletter-note {
    font-size: 0.8rem;
    color: #64748B;
    margin-top: 10px;
    margin-bottom: 0;
}

.tool-newsletter-note a {
    color: #b0aca6;
}

@media (max-width: 600px) {
    .tool-newsletter {
        padding: 24px 20px;
    }
}

/* ----------------------------------------------------------
   FEEDBACK / HELPFUL WIDGET
---------------------------------------------------------- */

.feedback-section {
    text-align: center;
    padding: 24px 0;
}

.feedback-section p {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0D1B2A;
    margin: 0 0 14px;
}

.feedback-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.feedback-btn {
    padding: 10px 22px;
    border: 2px solid #E2E4E8;
    border-radius: 999px;
    background: #fff;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0D1B2A;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

.feedback-btn:hover {
    border-color: #E8472F;
    background: #fff5f0;
}

.feedback-thanks {
    font-size: 0.9375rem;
    color: #2e7d32;
    font-weight: 600;
    margin: 12px 0 0;
}

/* ----------------------------------------------------------
   UTIL: screen-reader only
---------------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------------------------------------
   DIVIDER for result sections
---------------------------------------------------------- */

.rng-divider {
    border: none;
    border-top: 1px solid #E2E4E8;
    margin: 24px 0;
}

/* cache-buster: 2026-05-24T05:06:05Z */
