/* smtp-test.css */

.smtp-main { max-width: 760px; }

/* ── Form ───────────────────────────────────────────────────────────────────── */
.smtp-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
}

.smtp-fields-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 0.9rem;
}

.smtp-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.smtp-field-grow { flex: 1; min-width: 200px; }

.smtp-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.smtp-sel { min-width: 160px; }

.smtp-test-btn { width: 100%; padding: 0.8rem; font-size: 0.95rem; }

/* ── Warning ────────────────────────────────────────────────────────────────── */
.smtp-warn {
    background: #fff8e1;
    border: 1px solid #f0c040;
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    font-size: 0.86rem;
    color: #7a5000;
    margin-top: 0.8rem;
}

.smtp-warn.hidden { display: none; }
.smtp-warn code {
    display: block;
    font-family: var(--font-mono);
    background: #fff3cd;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-top: 0.3rem;
    font-size: 0.82rem;
}

/* ── Result ─────────────────────────────────────────────────────────────────── */
.smtp-result.hidden { display: none; }

.smtp-result-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
}

.smtp-result-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    background: #f0f4fa;
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 0.9rem;
}

.smtp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
}

.smtp-badge-ok    { background: #d4edda; color: #155724; }
.smtp-badge-fail  { background: #f8d7da; color: #721c24; }
.smtp-badge-warn  { background: #fff3cd; color: #856404; }

/* ── Info rows ──────────────────────────────────────────────────────────────── */
.smtp-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.smtp-info-table td {
    padding: 0.45rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.smtp-info-table tr:last-child td { border-bottom: none; }

.smtp-info-key {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    width: 160px;
}

.smtp-info-val {
    font-family: var(--font-mono);
    word-break: break-all;
}

/* ── Raw output box ─────────────────────────────────────────────────────────── */
.smtp-raw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f0f4fa;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.82rem;
    font-weight: 600;
}

.smtp-copy-btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}
.smtp-copy-btn:hover { background: var(--color-primary-dark, #1a56c4); }
.smtp-copy-btn.copied { background: #28a745; }

.smtp-raw-box {
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.8rem 1rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
    min-height: 60px;
}

/* ── EHLO capabilities ──────────────────────────────────────────────────────── */
.smtp-cap-list {
    padding: 0.6rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.smtp-cap {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: #e8f0fe;
    color: #1a3c6e;
}

.smtp-cap-starttls { background: #d4edda; color: #155724; font-weight: 700; }
.smtp-cap-auth     { background: #fff3cd; color: #856404; }

/* ── Guide ──────────────────────────────────────────────────────────────────── */
.smtp-guide {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 0.5rem;
}

.smtp-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    user-select: none;
    transition: background 0.15s;
}
.smtp-guide-header:hover { background: #f5f7fa; }

.smtp-guide-arrow {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
}
.smtp-guide-arrow.open { transform: rotate(180deg); }

.smtp-guide-body {
    display: none;
    padding: 1rem 1.2rem 1.2rem;
    font-size: 0.88rem;
    line-height: 1.65;
    border-top: 1px solid var(--color-border);
}
.smtp-guide-body.open { display: block; }
.smtp-guide-body h3 { margin: 1rem 0 0.3rem; font-size: 0.9rem; }
.smtp-guide-body p { margin: 0.3rem 0; }
.smtp-guide-body code {
    font-family: var(--font-mono);
    background: #f0f4fa;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.82rem;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .smtp-fields-row { flex-direction: column; }
    .smtp-sel { width: 100%; }
    .smtp-info-key { width: 100px; }
}
