/* ───────────── Base & theme ───────────── */
:root {
    --bg: #08090B;
    --card: #111318;
    --border: #292C33;
    --text: #fff;
    --muted: #6b7280;
    --input: #0d0f14;
    --header-bg: rgba(8, 9, 11, .85);
    --accent: #FF7A18;
    --gradient: linear-gradient(135deg, #FF7A18, #FF4D8D);
    --header-h: 64px;
    --gutter: 24px;
}

body.light {
    --bg: #f0f1f4;
    --card: #fff;
    --border: #e0e2e8;
    --text: #0a0b0e;
    --input: #f8f9fc;
    --header-bg: rgba(240, 241, 244, .85);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

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

button,
input,
textarea {
    font-family: Inter, system-ui, sans-serif;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #292C33;
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3f4a;
}

/* ───────────── Layout ───────────── */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    transition: .3s;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gutter);
    flex: 1 0 auto;
}

.header {
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gutter);
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.header-actions [hidden] {
    display: none;
}

.user-greeting {
    max-width: 160px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-greeting[hidden] {
    display: none;
}

.logo-img {
    display: none;
    width: auto;
    height: 40px;
    max-width: 140px;
    object-fit: contain;
}

body.light .logo-dark,
body:not(.light) .logo-light {
    display: block;
}

.theme {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    font-size: 18px;
}

.hero {
    text-align: center;
    padding: clamp(36px, 7vw, 64px) var(--gutter) clamp(28px, 5vw, 48px);
}

.badge {
    background: rgba(255, 122, 24, .1);
    border: 1px solid rgba(255, 122, 24, .3);
    border-radius: 99px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: .08em;
    text-transform: uppercase;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.hero p {
    font-size: clamp(15px, 2.2vw, 18px);
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

.maketextbold_logo {
    display: block;
    width: 100%;
    max-width: 700px;
    height: auto;
    margin: 0 auto;
    padding: 0;
}


.legal-content {
    width: 100%;
    max-width: 760px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
}

.legal-content h1,
.legal-content h2 {
    font-family: Sora, sans-serif;
}

.legal-content h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 5vw, 32px);
}

.legal-content h2 {
    margin: 28px 0 8px;
    font-size: 18px;
}

.legal-content p,
.legal-content li {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.legal-content p {
    margin: 0 0 12px;
}

.legal-content ul {
    padding-left: 22px;
}

/* ───────────── Footer ───────────── */

footer {
    margin-top: 60px;
    border-top: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
}

.site-footer {
    width: 100%;
    max-width: 1200px;
    min-height: 80px;
    margin: 0 auto;
    padding: 20px var(--gutter);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-left {
    font-size: 13px;
}

.footer-left strong {
    color: var(--text);
    font-weight: 700;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-right a {
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    transition: color .2s ease;
}

.footer-right a:hover {
    color: var(--text);
}


/* Mobile */
@media (max-width: 600px) {
    .site-footer {
        min-height: auto;
        padding: 20px var(--gutter);

        flex-direction: column;
        justify-content: center;
        gap: 12px;
        text-align: center;
    }

    .footer-right {
        gap: 18px;
    }
}

/* ───────────── Buttons ───────────── */
.ghost,
.gradient {
    border-radius: 10px;
    padding: 9px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    min-height: 40px;
}

.ghost {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.gradient {
    border: 0;
    background: var(--gradient);
    color: #fff;
}

a.ghost,
a.gradient {
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.logout-button {
    padding: 9px 14px;
}

/* ───────────── Generator ───────────── */
.workspace {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.7fr) 57px;
    gap: 20px;
    align-items: start;
}

.panel {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    min-width: 0;
}

.panel-title {
    font-family: Sora, sans-serif;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 14px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.textarea {
    display: block;
    width: 100%;
    min-height: 300px;
    resize: vertical;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text);
    font: 16px/1.5 Inter, system-ui, sans-serif; /* 16px stops iOS zoom-on-focus */
    outline: none;
}

.textarea:focus,
.search:focus {
    border-color: var(--accent);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 10px;
}

.toolbar > div:last-child {
    display: flex;
    gap: 8px;
}

.stats {
    font-size: 12px;
    color: var(--muted);
}

.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tab {
    flex-shrink: 0;
    padding: 6px 13px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.tab.active {
    background: var(--gradient);
    border-color: var(--accent);
    color: #fff;
}

.search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.search {
    width: 100%;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px 10px 36px;
    font-size: 16px;
    color: var(--text);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.count {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
}

.results {
    max-height: min(650px, 75vh);
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.result {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .02);
    min-height: 64px;
    height: auto;
    width: 100%;
}

.result:hover {
    border-color: rgba(255, 122, 24, .4);
    background: rgba(255, 122, 24, .04);
}

.result-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.result-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 5px;
}

.result-text {
    display: block;
    width: 100%;
    font-size: 16px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    height: auto;
    min-height: 24px;
}

.copy {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 8px 14px;
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.empty {
    text-align: center;
    padding: 32px 0;
    color: var(--muted);
    font-size: 14px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 16px;
    margin: 40px 0;
}

.feature {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 20px;
    background: var(--card);
}

.feature:hover {
    border-color: rgba(255, 122, 24, .4);
    box-shadow: 0 0 24px rgba(255, 122, 24, .08);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 122, 24, .15), rgba(255, 77, 141, .15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.feature-title {
    font-family: Sora, sans-serif;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}

.feature-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* ───────────── Donation card (index) ─────────────
   Now a normal grid item (no more position:fixed overlap).
   Desktop: sticky third column. Tablet: full-width bar. Mobile: stacked card. */
.donation-eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
}

.dialog-intro {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.donation-float {
    position: fixed;
    top: 80px;               /* just below the header; adjust to your header height */
    right: 16px;
    z-index: 1000;
    width: 240px;            /* fixed width so it doesn't stretch across the screen */
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .2);
}

a.donation-float-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 5px 18px rgba(255, 94, 65, .25);
}

.donation-float p {
    margin: 9px 4px 1px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

/* Navbar donate button */
.nav-donate-btn {
    display: none !important;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-donate-btn {
        display: inline-flex !important;
        align-items: center;
        padding: 6px 12px;
        min-height: 36px;
        font-size: 13px;
        text-decoration: none;
        border-radius: 8px;
    }

    .donation-float {
        display: none !important;
    }
}

/* ───────────── Auth + donate pages (login.html, donate.html) ───────────── */
.page-main {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}

.auth-card h1 {
    margin: 6px 0 8px;
    font-family: Sora, sans-serif;
    font-size: clamp(20px, 5vw, 24px);
    line-height: 1.3;
}

.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.auth-option {
    padding: 10px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.auth-option.selected {
    background: rgba(255, 122, 24, .14);
    color: var(--text);
}

.auth-form {
    display: grid;
    gap: 8px;
}

.auth-form .field {
    display: grid;
    gap: 8px;
}

.auth-form .field[hidden] {
    display: none;
}

.auth-form label,
.amount-options legend {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.auth-form input,
.custom-amount-option input {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input);
    color: var(--text);
    font: inherit;
    font-size: 16px; /* prevents iOS zoom on focus */
}

.auth-form input:focus,
.custom-amount-option input:focus {
    border-color: var(--accent);
    outline: 2px solid rgba(255, 122, 24, .18);
}

.dialog-primary {
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
}

.dialog-primary:disabled {
    opacity: .6;
    cursor: wait;
}

.notice {
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 122, 24, .3);
    border-radius: 8px;
    background: rgba(255, 122, 24, .08);
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
}

.notice[hidden] {
    display: none;
}

.notice.success {
    border-color: rgba(61, 220, 151, .45);
    background: rgba(61, 220, 151, .1);
}

.notice.error {
    border-color: rgba(255, 107, 107, .5);
    background: rgba(255, 107, 107, .1);
}

.amount-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.amount-options legend {
    margin-bottom: 10px;
    padding: 0;
}

.amount-options > label {
    position: relative;
    display: flex;
    min-height: 48px;
    min-width: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.amount-options > label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(255, 122, 24, .1);
}

.amount-options input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.amount-options input[type="radio"]:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.custom-amount-option {
    justify-content: space-between !important;
    gap: 8px;
    padding: 6px 9px;
    font-size: 12px !important;
}

.custom-amount-option input {
    flex: 1;
    width: 100%;
    max-width: 110px;
    padding: 7px;
    text-align: right;
}

.planned-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.planned-split strong {
    font-family: Sora, sans-serif;
    font-size: 16px;
}

.payu-disabled,
.payu-disabled:disabled {
    cursor: not-allowed;
    opacity: .48;
    filter: grayscale(.25);
}

.unavailable-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

/* ───────────── Responsive ───────────── */

/* Large tablets / small laptops: two panels side by side, donation becomes a full-width bar */
@media (max-width: 1050px) {
    .workspace {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    }

    .donation-float {
        grid-column: 1 / -1;
        position: static;
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 14px 16px;
        box-shadow: none;
    }

    a.donation-float-button {
        width: auto;
        flex: 0 0 auto;
        padding: 10px 24px;
    }

    .donation-float p {
        flex: 1;
        margin: 0;
        text-align: left;
    }
}

/* Tablets & phones: single column */
@media (max-width: 850px) {
    :root {
        --gutter: 18px;
    }

    .workspace {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .results {
        max-height: 60vh;
    }

    .textarea {
        min-height: 220px;
    }
}

/* Phones */
@media (max-width: 600px) {
    :root {
        --gutter: 14px;
        --header-h: 58px;
    }

    .logo-img {
        height: 34px;
        max-width: 110px;
    }

    .panel {
        padding: 16px;
        border-radius: 14px;
    }

    .header-actions {
        gap: 7px;
    }

    .user-greeting {
        display: none;
    }

    .header-actions .ghost {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 40px;
    }

    .theme {
        width: 40px;
        height: 40px;
    }

    .badge {
        font-size: 11px;
        padding: 5px 12px;
    }

    .textarea {
        min-height: 180px;
        padding: 14px;
    }

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

    .toolbar > div:last-child {
        justify-content: stretch;
    }

    .toolbar > div:last-child .ghost {
        flex: 1;
    }

    .donation-float {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    a.donation-float-button {
        width: 100%;
    }

    .donation-float p {
        text-align: center;
    }

   

    .features {
        margin: 28px 0;
        gap: 12px;
    }

    .page-main {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 20px;
        border-radius: 14px;
    }
}


.site-footer a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.site-footer a span {
    color: var(--muted);
}

.site-footer a:hover span {
    color: var(--text);
}


/* ================================
   PAYMENT DETAILS
================================ */

.payment-details {
    border: 0;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payment-details legend {
    padding: 0;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text, #ffffff);
}

.payment-details .form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.payment-details .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted, #9ca3af);
}

.payment-details .form-group input {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 0 14px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.05);
    color: var(--text, #ffffff);

    font-size: 14px;
    font-family: inherit;

    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.payment-details .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.payment-details .form-group input:focus {
    border-color: #665cf6;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(102, 92, 246, 0.15);
}

/* Email is readonly */
.payment-details .form-group input[readonly] {
    cursor: not-allowed;
    opacity: 0.75;
    background: rgba(255, 255, 255, 0.035);
}

/* Light mode */
body.light .payment-details legend {
    color: #171717;
}

body.light .payment-details .form-group label {
    color: #666;
}

body.light .payment-details .form-group input {
    background: #ffffff;
    color: #171717;
    border-color: #e5e7eb;
}

body.light .payment-details .form-group input::placeholder {
    color: #9ca3af;
}

body.light .payment-details .form-group input:focus {
    border-color: #665cf6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 92, 246, 0.12);
}

body.light .payment-details .form-group input[readonly] {
    background: #f5f5f7;
}
/* Very small phones */
@media (max-width: 360px) {
    .amount-options {
        grid-template-columns: 1fr;
    }

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

    .copy {
        width: 100%;
    }
}

/* Short landscape phones: don't let the sticky header eat the screen */
@media (max-height: 480px) and (orientation: landscape) {
    .header {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}