/* =========================================================
   WORD COUNTER WEBSITE
   Global Styles
========================================================= */


/* =========================================================
   1. CSS VARIABLES
========================================================= */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --background: #f8fafc;
    --surface: #ffffff;
    --surface-secondary: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border: #e2e8f0;
    --border-focus: #2563eb;

    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.04);

    --shadow-md:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --shadow-lg:
        0 20px 50px rgba(15, 23, 42, 0.10);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --container: 1180px;

    --transition: 0.25s ease;
}


/* =========================================================
   2. RESET
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text-primary);

    font-family:
        "Montserrat",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body,
button,
input,
textarea,
select {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
a,
summary,
label {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    outline: none;
}

button {
    cursor: pointer;
}


/* =========================================================
   3. GENERAL LAYOUT
========================================================= */

.container {
    width: calc(100% - 40px);
    max-width: var(--container);
    margin-inline: auto;
}

.content-container {
    max-width: 820px;
}

.visually-hidden {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* =========================================================
   4. HEADER
========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(255, 255, 255, 0.92);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.logo {
    display: inline-flex;
    align-items: center;

    font-size: 22px;
    font-weight: 800;

    letter-spacing: 0;

    color: var(--text-primary);
}

.logo::before {
    content: "W";

    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-right: 9px;

    border-radius: 10px;

    background: var(--primary);
    color: white;

    font-size: 18px;
    font-weight: 800;
}

.main-nav {
    display: flex;
    align-items: center;

    gap: 28px;

    margin-left: auto;
}

.main-nav a {
    position: relative;

    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 600;

    transition: color var(--transition);
}

.main-nav a:hover {
    color: var(--primary);
}

.main-nav a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -8px;

    width: 0;
    height: 2px;

    background: var(--primary);

    border-radius: 10px;

    transition: width var(--transition);
}

.main-nav a:hover::after {
    width: 100%;
}

.theme-toggle {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    background: var(--surface-secondary);

    border: 1px solid var(--border);

    border-radius: 12px;

    color: var(--text-secondary);

    font-size: 0;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition);
}

.theme-toggle svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    pointer-events: none;
}

.theme-toggle:hover {
    background: var(--primary-light);
    border-color: #bfdbfe;
    color: var(--primary);
    transform: translateY(-1px);
}


/* =========================================================
   5. TOOL / HERO SECTION
========================================================= */

.tool-section {
    padding: 70px 0 80px;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(37, 99, 235, 0.10),
            transparent 36%
        ),
        var(--background);
}

.hero-content {
    max-width: 760px;

    margin: 0 auto 36px;

    text-align: center;
}

.eyebrow {
    display: inline-flex;

    margin: 0 0 14px;

    padding: 7px 13px;

    background: var(--primary-light);

    border: 1px solid #dbeafe;
    border-radius: 100px;

    color: var(--primary);

    font-size: 13px;
    font-weight: 700;

    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 0;

    font-size: 46px;
    line-height: 1.08;
    text-transform: uppercase;

    letter-spacing: 0;

    color: var(--text-primary);
}

.hero-description {
    max-width: 650px;

    margin: 18px auto 0;

    color: var(--text-secondary);

    font-size: 18px;
}


/* =========================================================
   6. COUNTER CARD
========================================================= */

.counter-card {
    max-width: 1000px;

    margin-inline: auto;

    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);
}


/* =========================================================
   7. TEXTAREA
========================================================= */

.textarea-wrapper {
    position: relative;
}

#textInput {
    width: 100%;
    min-height: 330px;

    resize: vertical;

    padding: 22px;

    background: var(--surface);

    color: var(--text-primary);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    font-size: 17px;
    line-height: 1.7;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

#textInput::placeholder {
    color: var(--text-muted);
}

#textInput:hover {
    border-color: #cbd5e1;
}

#textInput:focus {
    border-color: var(--border-focus);

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.10);
}


/* =========================================================
   8. STATS GRID
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns: repeat(6, minmax(0, 1fr));

    margin-top: 18px;

    background: var(--surface-secondary);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    overflow: hidden;
}

.stat-item {
    min-height: 96px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 14px 10px;

    text-align: center;

    border-right: 1px solid var(--border);
}

.stat-item:last-child {
    border-right: none;
}

.stat-number {
    display: block;

    margin-bottom: 3px;

    color: var(--text-primary);

    font-size: 22px;
    font-weight: 800;

    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);

    font-size: 12px;
    font-weight: 600;

    line-height: 1.35;
}


/* =========================================================
   9. WORD LIMIT
========================================================= */

.limit-section {
    margin-top: 22px;

    padding: 18px;

    background: var(--surface-secondary);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.limit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.limit-header > label {
    color: var(--text-primary);

    font-size: 14px;
    font-weight: 700;
}

.limit-input-wrapper {
    display: flex;
    align-items: center;

    gap: 8px;

    color: var(--text-secondary);

    font-size: 13px;
}

#wordLimit {
    width: 90px;

    padding: 9px 12px;

    background: var(--surface);

    color: var(--text-primary);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    font-weight: 700;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

#wordLimit:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* =========================================================
   10. PROGRESS BAR
========================================================= */

.progress-wrapper {
    width: 100%;
    height: 8px;

    margin-top: 16px;

    overflow: hidden;

    background: #dbe2ea;

    border-radius: 100px;
}

.progress-bar {
    width: 0%;
    height: 100%;

    background: var(--primary);

    border-radius: inherit;

    transition:
        width 0.25s ease,
        background-color 0.25s ease;
}

.limit-message {
    margin: 9px 0 0;

    color: var(--text-muted);

    font-size: 13px;
    font-weight: 500;
}


/* =========================================================
   11. BUTTONS / TOOL ACTIONS
========================================================= */

.tool-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 22px;
}

.primary-actions {
    display: flex;
    align-items: center;

    gap: 10px;
}

.btn {
    min-height: 43px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 17px;

    border: 1px solid transparent;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 700;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

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

.btn-primary {
    background: var(--primary);
    color: white;

    box-shadow:
        0 5px 14px rgba(37, 99, 235, 0.20);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);

    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface-secondary);

    color: var(--text-primary);

    border-color: #cbd5e1;
}

.btn:disabled {
    cursor: not-allowed;

    opacity: 0.45;

    transform: none;

    box-shadow: none;
}


/* =========================================================
   12. PRIVACY MESSAGE
========================================================= */

.privacy-message {
    margin: 18px 0 0;

    color: var(--text-muted);

    font-size: 13px;

    text-align: center;
}


/* =========================================================
   13. COMMON SECTION STYLES
========================================================= */

.content-section,
.features-section,
.faq-section {
    padding: 90px 0;
}

.content-section {
    background: var(--surface);
}

.content-section h2,
.section-heading h2 {
    margin: 0 0 15px;

    color: var(--text-primary);

    font-size: 30px;
    line-height: 1.2;

    letter-spacing: 0;
}

.content-section p {
    margin: 0 0 18px;

    color: var(--text-secondary);

    font-size: 17px;
}

.section-heading {
    max-width: 680px;

    margin: 0 auto 40px;

    text-align: center;
}

.section-heading p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 16px;
}


/* =========================================================
   14. FEATURES
========================================================= */

.features-section {
    background: var(--background);
}

.features-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 22px;
}

.feature-card {
    padding: 30px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);

    border-color: #bfdbfe;

    box-shadow: var(--shadow-md);
}

.feature-card::before {
    content: "✓";

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 20px;

    background: var(--primary-light);

    border-radius: 11px;

    color: var(--primary);

    font-weight: 800;
}

.feature-card h3 {
    margin: 0 0 10px;

    color: var(--text-primary);

    font-size: 19px;
}

.feature-card p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 14px;
}


/* =========================================================
   15. FAQ
========================================================= */

.faq-section {
    background: var(--surface);
}

.faq-list {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.faq-list details {
    padding: 0 20px;

    background: var(--background);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    transition: border-color var(--transition);
}

.faq-list details:hover {
    border-color: #cbd5e1;
}

.faq-list summary {
    position: relative;

    padding: 20px 35px 20px 0;

    cursor: pointer;

    list-style: none;

    color: var(--text-primary);

    font-size: 15px;
    font-weight: 700;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: "+";

    position: absolute;

    top: 50%;
    right: 2px;

    transform: translateY(-50%);

    color: var(--primary);

    font-size: 22px;
    font-weight: 500;

    transition: transform var(--transition);
}

.faq-list details[open] summary::after {
    transform:
        translateY(-50%)
        rotate(45deg);
}

.faq-list details p {
    margin: -3px 0 20px;

    padding-right: 35px;

    color: var(--text-secondary);

    font-size: 14px;
}


/* =========================================================
   16. FOOTER
========================================================= */

.site-footer {
    background: #0f172a;
    color: #cbd5e1;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 40px;

    padding-top: 54px;
    padding-bottom: 40px;
}

.footer-brand {
    max-width: 330px;
}

.footer-brand .logo {
    color: white;
}

.footer-brand p {
    margin: 16px 0 0;

    color: #94a3b8;

    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;

    gap: 22px;
}

.footer-links a {
    color: #cbd5e1;

    font-size: 14px;
    font-weight: 500;

    transition: color var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom .container {
    min-height: 64px;

    display: flex;
    align-items: center;
}

.footer-bottom p {
    margin: 0;

    color: #64748b;

    font-size: 13px;
}


/* =========================================================
   17. FOCUS / ACCESSIBILITY
========================================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}


/* =========================================================
   18. DARK MODE
   JavaScript later body par .dark-mode add karega
========================================================= */

body.dark-mode {
    --background: #0b1120;
    --surface: #111827;
    --surface-secondary: #172033;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border: #263246;

    --primary-light: rgba(37, 99, 235, 0.15);

    --shadow-sm:
        0 1px 2px rgba(0, 0, 0, 0.20);

    --shadow-md:
        0 10px 30px rgba(0, 0, 0, 0.25);

    --shadow-lg:
        0 20px 50px rgba(0, 0, 0, 0.35);
}

body.dark-mode .site-header {
    background: rgba(17, 24, 39, 0.92);
}

body.dark-mode .eyebrow {
    border-color: rgba(96, 165, 250, 0.20);
}

body.dark-mode #textInput::placeholder {
    color: var(--text-muted);
}

body.dark-mode .progress-wrapper {
    background: #334155;
}

body.dark-mode .feature-card:hover {
    border-color: #3b82f6;
}


/* =========================================================
   MODERN GLOBAL HEADER / FOOTER OVERRIDES
========================================================= */

.site-header {
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.header-inner {
    min-height: 70px;
}

.logo {
    gap: 10px;
    flex-shrink: 0;
    letter-spacing: 0;
}

.logo::before {
    content: none;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.logo-accent {
    color: #2563eb;
}

.footer-brand .logo-accent,
body.dark-mode .logo-accent {
    color: #60a5fa;
}

.main-nav {
    gap: 8px;
}

.nav-link,
.nav-dropdown-toggle,
.main-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    transition:
        background var(--transition),
        color var(--transition);
}

.main-nav a::after {
    content: none;
}

.nav-link:hover,
.nav-link.active,
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"],
.main-nav a:hover,
.main-nav a.active {
    background: var(--surface-secondary);
    color: var(--primary);
}

.nav-link-featured {
    color: var(--primary);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: transparent;
    border: 0;
}

.nav-dropdown-toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform var(--transition);
}

.nav-dropdown-toggle[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(225deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 238px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
        opacity var(--transition),
        transform var(--transition),
        visibility var(--transition);
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    width: 100%;
    justify-content: flex-start;
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.theme-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
}

body.dark-mode .theme-toggle {
    color: #fbbf24;
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 999px;
    transition:
        transform var(--transition),
        opacity var(--transition);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.mobile-menu-inner {
    display: grid;
    gap: 6px;
    padding-top: 12px;
    padding-bottom: 14px;
}

.mobile-menu a {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: var(--surface-secondary);
    color: var(--primary);
}

.site-footer {
    background: #0b1220;
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(135px, 1fr));
    gap: 34px;
}

.footer-brand p {
    margin-top: 14px;
}

.footer-privacy {
    margin-top: 6px !important;
    color: #cbd5e1 !important;
}

.footer-column {
    display: grid;
    align-content: start;
    gap: 10px;
}

.footer-column h2 {
    margin: 0 0 4px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.footer-column a {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition);
}

.footer-column a:hover {
    color: #ffffff;
}

body.dark-mode .site-header {
    background: rgba(15, 23, 42, 0.92);
}

body.dark-mode .mobile-menu {
    background: var(--surface);
}


/* =========================================================
   19. TABLET RESPONSIVE
========================================================= */

@media (max-width: 980px) {

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stat-item {
        border-bottom: 1px solid var(--border);
    }

    .stat-item:nth-child(3n) {
        border-right: none;
    }

    .stat-item:nth-child(n + 4) {
        border-bottom: none;
    }

    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .features-grid .feature-card:last-child {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   20. MOBILE NAV + LAYOUT
========================================================= */

@media (max-width: 768px) {

    .container {
        width: calc(100% - 28px);
    }

    .header-inner {
        position: relative;
        min-height: 66px;
        padding: 0;
        gap: 12px;
    }

    .logo {
        max-width: calc(100% - 112px);
        font-size: 19px;
    }

    .logo-mark {
        width: 34px;
        height: 34px;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .header-actions {
        position: fixed;
        top: 13px;
        right: 14px;
        z-index: 1002;
        transform: none;
    }

    .tool-section {
        padding: 45px 0 55px;
    }

    .hero-content {
        margin-bottom: 26px;
    }

    .hero-content h1 {
        font-size: 34px;
        letter-spacing: 0;
    }

    .hero-description {
        max-width: 330px;
        font-size: 16px;
    }

    .counter-card {
        padding: 15px;

        border-radius: 16px;
    }

    #textInput {
        min-height: 280px;

        padding: 16px;

        font-size: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-item {
        min-height: 86px;

        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .stat-item:nth-child(2n) {
        border-right: none;
    }

    .stat-item:nth-child(3) {
        border-right: 1px solid var(--border);
    }

    .stat-item:nth-child(4) {
        border-right: none;
    }

    .stat-item:nth-child(n + 5) {
        border-bottom: none;
    }

    .stat-number {
        font-size: 20px;
    }

    .limit-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 10px;
    }

    .tool-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-actions {
        display: grid;

        grid-template-columns: repeat(3, minmax(0, 1fr));

        width: 100%;
    }

    .tool-actions > .btn {
        width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-grid .feature-card:last-child {
        grid-column: auto;
    }

    .content-section,
    .features-section,
    .faq-section {
        padding: 65px 0;
    }

    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-top: 45px;
        gap: 30px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   21. SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .container {
        width: calc(100% - 20px);
    }

    .hero-content h1 {
        font-size: 30px;
        letter-spacing: 0;
    }

    .eyebrow {
        font-size: 11px;
    }

    .counter-card {
        padding: 11px;
    }

    #textInput {
        min-height: 250px;
    }

    .stat-label {
        font-size: 11px;
    }

    .primary-actions {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }

    .feature-card {
        padding: 24px;
    }

    .footer-links {
        flex-direction: column;

        gap: 14px;
    }

    .logo-text {
        font-size: 18px;
    }

    .theme-toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   COMMON APP PRESETS
========================================================= */

.common-app-presets {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 22px;
    padding: 18px;

    background: var(--primary-light);

    border: 1px solid #dbeafe;
    border-radius: var(--radius-md);
}

.preset-info {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.preset-info strong {
    color: var(--text-primary);

    font-size: 14px;
}

.preset-info span {
    color: var(--text-secondary);

    font-size: 13px;
}

.preset-buttons {
    display: flex;

    gap: 8px;
}

.preset-button {
    padding: 9px 13px;

    background: var(--surface);

    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 8px;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.preset-button:hover {
    border-color: var(--primary);

    color: var(--primary);
}

/* =========================================================
   CONTACT FORM
========================================================= */

.contact-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;

    padding: 13px 15px;

    background: var(--surface);
    color: var(--text-primary);

    border: 1px solid var(--border);
    border-radius: 10px;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-group textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.10);
}

.form-note {
    margin: 0;

    color: var(--text-muted);

    font-size: 13px;
}

body.dark-mode .form-group select {
    background: var(--surface);
    color: var(--text-primary);
}

.preset-button.active {
    background: var(--primary);

    border-color: var(--primary);

    color: #ffffff;
}


/* Common App Mobile */

@media (max-width: 600px) {

    .common-app-presets {
        align-items: stretch;
        flex-direction: column;
    }

    .preset-buttons {
        display: grid;

        grid-template-columns: 1fr 1fr;
    }

    .preset-button {
        width: 100%;
    }
}


/* =========================================================
   22. REDUCED MOTION ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* Reading, keyboard access, and resilient narrow layouts. */
:root {
    --status-danger: #b91c1c;
    --status-warning: #92400e;
    --status-success: #166534;
}

body.dark-mode {
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --status-danger: #fca5a5;
    --status-warning: #fcd34d;
    --status-success: #86efac;
}

body.dark-mode .btn-primary,
body.dark-mode .preset-button.active {
    color: #0f172a;
}

body.dark-mode .btn-primary:hover {
    color: #0f172a;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 12px 16px;
    background: var(--surface);
    color: var(--text-primary);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

#main-content {
    scroll-margin-top: 85px;
}

.breadcrumb {
    padding-top: 18px;
    font-size: 13px;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.breadcrumb li {
    min-width: 0;
    overflow-wrap: anywhere;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: 10px;
    color: var(--text-muted);
}

.breadcrumb a,
.content-container a:not(.btn),
.feature-card p a,
.related-links a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.related-links {
    padding-left: 22px;
}

.related-links li {
    margin: 12px 0;
}

.quick-answer {
    max-width: 820px;
    margin-inline: auto;
}

.quick-answer h2 {
    font-size: 24px;
}

.quick-answer a:not(.btn) {
    text-decoration: underline;
}

.guide-page .hero-content {
    max-width: 820px;
    text-align: left;
}

.guide-page .hero-description {
    max-width: none;
    margin-inline: 0;
}

.guide-page .tool-section {
    padding-bottom: 40px;
}

.feature-card,
.stat-item,
.footer-column,
.footer-brand {
    min-width: 0;
    overflow-wrap: anywhere;
}

.btn {
    min-height: 44px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.feature-card .btn {
    max-width: 100%;
    margin-top: 16px;
}

.tool-actions .btn {
    min-width: 145px;
}

.stat-number {
    font-variant-numeric: tabular-nums;
    min-height: 27px;
}

.limit-message {
    min-height: 42px;
}

.preset-button {
    min-height: 44px;
}

fieldset.contact-form {
    margin: 0 0 24px;
    padding: 20px;
    border: 1px solid var(--border);
}

fieldset.contact-form legend {
    font-weight: 700;
}

.footer-bottom p {
    color: #94a3b8;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

@media (max-width: 1100px) and (min-width: 769px) {
    .footer-inner {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 32px;
    }

    .content-section h2,
    .section-heading h2 {
        font-size: 26px;
    }

    .tool-section {
        padding-top: 26px;
    }

    .header-actions {
        position: static;
    }

    .logo {
        max-width: none;
    }

    .theme-toggle,
    .mobile-menu-toggle {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }

    .primary-actions {
        grid-template-columns: 1fr;
    }

    .tool-actions .btn {
        width: 100%;
    }

    .stat-item:nth-child(4) {
        border-bottom: 1px solid var(--border);
    }
}
