* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f0f3;
    color: #2d2d2d;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 1.5rem;
}

/* ─── Page layout ───────────────────────────────────────────────────────── */
.page-wrap { width: 100%; max-width: 1200px; }
header {
    text-align: center; margin-bottom: 2rem; padding: 1.5rem 1rem;
    background: #ffffff; border-radius: 10px; border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
header h1 { font-size: 1.4rem; color: #1a1a2e; font-weight: 700; }
header h1 span { color: #ffde00; }
.subtitle { font-size: 0.8rem; color: #777; margin-top: 0.25rem; }
.disclaimer {
    display: inline-block; font-size: 0.65rem; color: #999;
    background: #fafafa; border: 1px solid #e0e0e0; border-radius: 4px;
    padding: 0.2rem 0.5rem; margin-top: 0.5rem;
}

/* ─── Two-column CSS Grid (60/40) ───────────────────────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .two-col {
        grid-template-columns: 3fr 2fr;
        gap: 3rem;
    }
    .col-info {
        position: sticky;
        top: 2rem;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        padding-left: 2.5rem;
        border-left: 1px solid #e8e8e8;
    }
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
    background: #ffffff; border-radius: 8px; padding: 1.25rem;
    margin-bottom: 0.75rem; border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-title {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: #999; margin-bottom: 0.75rem;
}
label { display: block; font-size: 0.8rem; color: #555; margin-bottom: 0.2rem; margin-top: 0.6rem; font-weight: 500; }
.card label:first-of-type { margin-top: 0; }
input, select, textarea {
    width: 100%; padding: 0.55rem 0.7rem; border: 1px solid #ddd;
    border-radius: 6px; background: #fafafa; color: #2d2d2d;
    font-size: 0.85rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: #ffde00; box-shadow: 0 0 0 3px rgba(255,222,0,0.15); }
input::placeholder, textarea::placeholder { color: #bbb; }
textarea { resize: vertical; min-height: 100px; font-family: 'SF Mono','Fira Code',monospace; font-size: 0.75rem; line-height: 1.5; }
.hint { font-size: 0.68rem; color: #aaa; margin-top: 0.2rem; }
.hint strong { color: #888; }

/* ─── Mode toggle ───────────────────────────────────────────────────────── */
.mode-toggle {
    display: flex; border: 1px solid #ddd; border-radius: 6px;
    overflow: hidden; margin-bottom: 0.6rem;
}
.mode-toggle button {
    flex: 1; padding: 0.5rem; border: none; background: #fafafa;
    color: #888; cursor: pointer; font-size: 0.78rem; font-weight: 500; transition: all 0.15s;
}
.mode-toggle button.active { background: #ffde00; color: #1a1a2e; font-weight: 600; }

/* ─── Sender toggle ────────────────────────────────────────────────────── */
.sender-toggle {
    display: flex; border: 1px solid #ddd; border-radius: 6px;
    overflow: hidden; margin-bottom: 0.6rem;
}
.sender-toggle button {
    flex: 1; padding: 0.45rem 0.5rem; border: none; background: #fafafa;
    color: #888; cursor: pointer; font-size: 0.75rem; font-weight: 500; transition: all 0.15s;
}
.sender-toggle button.active { background: #ffde00; color: #1a1a2e; font-weight: 600; }

/* ─── Domain row ────────────────────────────────────────────────────────── */
.domain-row { display: flex; align-items: center; }
.domain-row input:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.domain-row .at {
    padding: 0.55rem 0.4rem; background: #f0f0f0; border: 1px solid #ddd;
    border-left: none; border-right: none; color: #666; font-weight: 600; font-size: 0.85rem;
}
.domain-row input:last-child { border-radius: 0 6px 6px 0; border-left: none; }

/* ─── SMTP config ───────────────────────────────────────────────────────── */
.smtp-config {
    background: #fafafa; border: 1px solid #e8e8e8; border-radius: 6px;
    padding: 0.75rem; margin-top: 0.5rem; font-size: 0.75rem;
    font-family: 'SF Mono','Fira Code',monospace; line-height: 1.7;
}
.smtp-config .cfg-row { display: flex; gap: 0.5rem; }
.smtp-config .cfg-label { color: #999; min-width: 90px; }
.smtp-config .cfg-value { color: #2d2d2d; font-weight: 500; word-break: break-all; }
.smtp-btn-row { display: flex; gap: 0.4rem; margin-top: 0.6rem; flex-wrap: wrap; }
.copy-smtp-btn {
    padding: 0.35rem 0.75rem; border: 1px solid #ddd;
    border-radius: 4px; background: #fff; color: #555; font-size: 0.7rem;
    cursor: pointer; transition: all 0.15s;
}
.copy-smtp-btn:hover { border-color: #ffde00; color: #1a1a2e; }

/* ─── Test SMTP button ──────────────────────────────────────────────────── */
.btn-test-smtp {
    padding: 0.35rem 0.75rem; border: 1px solid #28a745;
    border-radius: 4px; background: #28a745; color: #fff; font-size: 0.7rem;
    font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.btn-test-smtp:hover { background: #218838; border-color: #218838; }
.btn-test-smtp:disabled { background: #ccc; border-color: #ccc; cursor: not-allowed; }
.smtp-test-result { margin-top: 0.5rem; margin-bottom: 0; }

/* ─── Code examples ─────────────────────────────────────────────────────── */
.code-examples { margin-top: 0.75rem; }
.code-tabs {
    display: flex; border-bottom: 1px solid #e8e8e8; margin-bottom: 0;
}
.code-tab {
    padding: 0.35rem 0.7rem; border: none; background: none;
    font-size: 0.7rem; font-weight: 500; color: #888; cursor: pointer;
    border-bottom: 2px solid transparent; transition: all 0.15s;
}
.code-tab.active { color: #1a1a2e; border-bottom-color: #ffde00; }
.code-tab:hover { color: #555; }
.code-block {
    background: #1a1a2e; color: #e0e0e0; padding: 0.75rem;
    border-radius: 0 0 6px 6px; font-size: 0.68rem;
    font-family: 'SF Mono','Fira Code',monospace;
    line-height: 1.6; overflow-x: auto; white-space: pre;
    margin: 0;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.btn-send {
    flex: 2; padding: 0.7rem; border: none; border-radius: 8px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    background: #ffde00; color: #1a1a2e; transition: all 0.15s;
}
.btn-send:hover { background: #f5d400; box-shadow: 0 2px 8px rgba(255,222,0,0.3); }
.btn-send:disabled { background: #e0e0e0; color: #999; cursor: not-allowed; box-shadow: none; }
.btn-curl {
    flex: 1; padding: 0.7rem; border: 1px solid #ddd; border-radius: 8px;
    font-size: 0.8rem; font-weight: 500; cursor: pointer;
    background: #fff; color: #555; transition: all 0.15s;
}
.btn-curl:hover { border-color: #ffde00; color: #1a1a2e; }
.btn-clear {
    display: block; width: 100%; padding: 0.5rem; border: 1px solid #ddd;
    border-radius: 6px; background: transparent; color: #999;
    font-size: 0.75rem; cursor: pointer; margin-top: 0.5rem; transition: all 0.15s;
}
.btn-clear:hover { border-color: #e74c3c; color: #e74c3c; }

/* ─── Results ───────────────────────────────────────────────────────────── */
.result {
    margin-top: 0.75rem; padding: 0.75rem; border-radius: 6px;
    font-size: 0.75rem; font-family: 'SF Mono','Fira Code',monospace;
    white-space: pre-wrap; word-break: break-all; display: none; line-height: 1.5;
}
.result.success { display: block; background: #eafbe7; border: 1px solid #b7e4af; color: #256b1b; }
.result.error { display: block; background: #fdeaea; border: 1px solid #f0b8b8; color: #8b1a1a; }
.result.info { display: block; background: #eaf4fd; border: 1px solid #b8d9f0; color: #1a4a6b; }
.result.curl { display: block; background: #2d2d2d; border: 1px solid #444; color: #e0e0e0; cursor: text; user-select: all; }

/* ─── CORS note ─────────────────────────────────────────────────────────── */
.cors-note {
    margin-top: 0.5rem; padding: 0.6rem 0.75rem; border-radius: 6px;
    background: #fffbe6; border: 1px solid #ffe58f; font-size: 0.7rem; color: #8b6914;
    display: none;
}
.cors-note a { color: #b8860b; font-weight: 500; }

/* ─── Info panel (right column) ─────────────────────────────────────────── */
.info-block { margin-bottom: 1.25rem; }
.info-block h2 { font-size: 0.85rem; color: #1a1a2e; margin-bottom: 0.6rem; }

/* Resource grid */
.resource-grid { display: grid; grid-template-columns: 1fr; gap: 0.4rem; }
.resource-link {
    display: block; padding: 0.5rem 0.65rem; background: #fff;
    border: 1px solid #e8e8e8; border-radius: 6px; text-decoration: none;
    transition: all 0.15s; font-size: 0.75rem;
}
.resource-link:hover { border-color: #ffde00; box-shadow: 0 2px 6px rgba(255,222,0,0.15); }
.resource-link .r-title { color: #1a1a2e; font-weight: 600; display: block; }
.resource-link .r-desc { color: #999; font-size: 0.65rem; margin-top: 0.1rem; display: block; }

/* ─── FAQ ───────────────────────────────────────────────────────────────── */
.faq-section h2 { margin-bottom: 0.5rem; }
.faq-item {
    border: 1px solid #e8e8e8; border-radius: 6px; margin-bottom: 0.35rem;
    background: #fff; transition: border-color 0.15s;
}
.faq-item:hover { border-color: #ffde00; }
.faq-item summary {
    cursor: pointer; padding: 0.55rem 0.7rem; font-size: 0.75rem;
    font-weight: 500; color: #333; list-style: none;
    display: flex; align-items: center; gap: 0.35rem;
}
.faq-item summary::before { content: "\25B8"; color: #ffde00; font-size: 0.65rem; flex-shrink: 0; }
.faq-item[open] summary::before { content: "\25BE"; }
.faq-item p, .faq-item .faq-table-wrap {
    padding: 0 0.7rem 0.55rem; font-size: 0.7rem; color: #555;
    line-height: 1.6; margin: 0;
}
.faq-item a { color: #b8860b; }
.faq-item code { font-size: 0.65rem; background: #f5f5f5; padding: 0.1rem 0.3rem; border-radius: 3px; }

/* Comparison table inside FAQ */
.faq-table-wrap { overflow-x: auto; }
.compare-table {
    width: 100%; border-collapse: collapse; font-size: 0.65rem; margin-top: 0.25rem;
}
.compare-table th {
    text-align: left; padding: 0.3rem 0.4rem; background: #fafafa;
    border-bottom: 1px solid #e8e8e8; color: #666; font-weight: 600;
}
.compare-table td {
    padding: 0.25rem 0.4rem; border-bottom: 1px solid #f0f0f0; color: #555;
}
.compare-table code { font-size: 0.6rem; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer-note {
    text-align: center; font-size: 0.65rem; color: #888;
    margin-top: 0; padding: 1.25rem 1rem;
    background: #ffffff; border-radius: 10px; border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    line-height: 1.7;
}
.footer-note a { color: #b8860b; text-decoration: none; }
.footer-note a:hover { text-decoration: underline; }
.footer-note code { font-size: 0.63rem; background: #f5f5f5; padding: 0.1rem 0.3rem; border-radius: 3px; }

/* ─── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid #1a1a2e; border-top-color: transparent;
    border-radius: 50%; animation: spin 0.6s linear infinite;
    vertical-align: middle; margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Preview ───────────────────────────────────────────────────────────── */
.preview-toggle { font-size: 0.7rem; color: #b8860b; cursor: pointer; margin-top: 0.4rem; display: inline-block; font-weight: 500; }
.preview-toggle:hover { color: #8b6914; }
.preview-frame { margin-top: 0.4rem; border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden; display: none; }
.preview-frame iframe { width: 100%; height: 200px; border: none; }

/* ─── Tooltips ──────────────────────────────────────────────────────────── */
.tooltip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%;
    background: #e8e8e8; color: #666; font-size: 0.6rem; font-weight: 700;
    cursor: help; position: relative; vertical-align: middle; margin-left: 0.3rem;
    transition: background 0.15s;
}
.tooltip:hover { background: #ffde00; color: #1a1a2e; }
.tooltip::after {
    content: attr(aria-label);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%); width: 220px;
    padding: 0.45rem 0.6rem; border-radius: 6px;
    background: #1a1a2e; color: #e8e8e8; font-size: 0.65rem;
    font-weight: 400; line-height: 1.5; text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}
.tooltip::before {
    content: ''; position: absolute; bottom: calc(100% + 4px); left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: #1a1a2e;
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}
.tooltip:hover::after, .tooltip:hover::before { opacity: 1; visibility: visible; }

/* ─── Hidden ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Mobile (below 1024px) ─────────────────────────────────────────────── */
@media (max-width: 1023px) {
    body { padding: 1.5rem 1rem; }
    .col-info { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e8e8e8; }
    .btn-row { flex-direction: column; }
    .tooltip::after { width: 180px; left: 0; transform: translateX(-10%); }
}
