/* ==========================================================================
   IPM Email Domain Test - Admin Styles
   ========================================================================== */

.ipm-edt-wrap {
    max-width: 960px;
}

.ipm-edt-wrap h1 {
    display: flex;
    align-items: center;
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 10px;
    padding: 9px 0 4px;
}

.ipm-edt-wrap > .description {
    font-size: 14px;
    margin-bottom: 24px;
}

/* ---------- Form ---------- */

.ipm-edt-form-container {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

#ipm-edt-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#ipm-edt-domain {
    flex: 1 1 300px;
    min-width: 200px;
    max-width: 450px;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #8c8f94;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#ipm-edt-domain:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

#ipm-edt-submit {
    white-space: nowrap;
}

/* ---------- Input validation hint ---------- */

.ipm-edt-input-hint {
    flex-basis: 100%;
    font-size: 12px;
    margin-top: 2px;
    padding: 2px 0;
    line-height: 1.4;
}

.ipm-edt-hint-ok {
    color: #00a32a;
}

.ipm-edt-hint-error {
    color: #d63638;
}

/* ---------- Cooldown counter ---------- */

#ipm-edt-cooldown {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #8c8f94;
    min-width: 28px;
}

/* ---------- Loading ---------- */

#ipm-edt-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 14px;
    color: #50575e;
}

#ipm-edt-loading .spinner {
    float: none;
    margin: 0;
}

/* ---------- Error ---------- */

#ipm-edt-error {
    margin: 0 0 20px;
}

/* ---------- Results heading ---------- */

#ipm-edt-results > h2 {
    font-size: 20px;
    margin: 0 0 16px;
}

#ipm-edt-domain-display {
    font-size: 18px;
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---------- Summary bar ---------- */

.ipm-edt-summary-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.ipm-edt-summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    gap: 6px;
    border-right: 1px solid #f0f0f1;
    transition: background 0.15s;
}

.ipm-edt-summary-item:last-child {
    border-right: none;
}

.ipm-edt-summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: #dcdcde;
}

.ipm-edt-summary-item.status-pass .ipm-edt-summary-icon {
    background: #00a32a;
}

.ipm-edt-summary-item.status-fail .ipm-edt-summary-icon {
    background: #d63638;
}

.ipm-edt-summary-item.status-warning .ipm-edt-summary-icon {
    background: #dba617;
}

.ipm-edt-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Result cards ---------- */

.ipm-edt-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-left-width: 4px;
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    overflow: hidden;
}

.ipm-edt-card.status-pass {
    border-left-color: #00a32a;
}

.ipm-edt-card.status-fail {
    border-left-color: #d63638;
}

.ipm-edt-card.status-warning {
    border-left-color: #dba617;
}

/* Card header */

.ipm-edt-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f1;
}

.ipm-edt-card-header .ipm-edt-status-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
}

.ipm-edt-card.status-pass .ipm-edt-card-header .ipm-edt-status-icon {
    background: #00a32a;
}

.ipm-edt-card.status-fail .ipm-edt-card-header .ipm-edt-status-icon {
    background: #d63638;
}

.ipm-edt-card.status-warning .ipm-edt-card-header .ipm-edt-status-icon {
    background: #dba617;
}

.ipm-edt-card-header h3 {
    flex: 1;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

.ipm-edt-card-header h3 small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #8c8f94;
    margin-top: 2px;
}

.ipm-edt-status-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.ipm-edt-card.status-pass .ipm-edt-status-label {
    background: #edfaef;
    color: #00a32a;
}

.ipm-edt-card.status-fail .ipm-edt-status-label {
    background: #fce8e8;
    color: #d63638;
}

.ipm-edt-card.status-warning .ipm-edt-status-label {
    background: #fff8e1;
    color: #996800;
}

/* Card body */

.ipm-edt-card-body {
    padding: 16px 20px;
}

.ipm-edt-record-block {
    margin-bottom: 12px;
}

.ipm-edt-record-block strong {
    display: block;
    font-size: 12px;
    color: #8c8f94;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.ipm-edt-record-text {
    display: block;
    background: #f6f7f7;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    word-break: break-all;
    white-space: pre-wrap;
    color: #1d2327;
    border: 1px solid #e0e0e0;
}

.ipm-edt-details {
    font-size: 13px;
    line-height: 1.6;
    color: #3c434a;
    padding: 8px 0 0;
}

/* DKIM selectors */

.ipm-edt-dkim-selector-item {
    margin-bottom: 10px;
}

.ipm-edt-dkim-selector-item .ipm-edt-selector-name {
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 2px;
}

/* MTA-STS policy */

.ipm-edt-mta-policy {
    margin-top: 12px;
}

.ipm-edt-mta-policy strong {
    display: block;
    font-size: 12px;
    color: #8c8f94;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.ipm-edt-policy-content {
    background: #f6f7f7;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    border: 1px solid #e0e0e0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* BIMI extra */

.ipm-edt-bimi-extra {
    margin: 8px 0;
    font-size: 13px;
    color: #3c434a;
}

.ipm-edt-bimi-extra strong {
    color: #1d2327;
}

/* Card footer */

.ipm-edt-card-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f1;
    background: #fafafa;
}

.ipm-edt-info-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
}

/* ---------- Infographic ---------- */

.ipm-edt-infographic {
    margin-top: 16px;
}

.ipm-edt-infographic-inner {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

.ipm-edt-svg {
    width: 100%;
    height: auto;
    max-width: 800px;
    display: block;
}

/* ---------- "Without X" warning box ---------- */

.ipm-edt-without-box {
    margin-top: 18px;
    background: #fef8f8;
    border: 1px solid #f0c4c4;
    border-left: 4px solid #d63638;
    border-radius: 6px;
    padding: 18px 22px 14px;
}

.ipm-edt-without-box h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #d63638;
}

.ipm-edt-without-box ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ipm-edt-without-box li {
    position: relative;
    padding: 7px 0 7px 22px;
    font-size: 13px;
    line-height: 1.65;
    color: #3c434a;
    border-bottom: 1px solid #f0e0e0;
}

.ipm-edt-without-box li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ipm-edt-without-box li::before {
    content: "\26A0";
    position: absolute;
    left: 0;
    top: 7px;
    color: #d63638;
    font-size: 13px;
}

.ipm-edt-without-box li strong {
    color: #1d2327;
}

/* ---------- Responsive ---------- */

@media (max-width: 782px) {
    .ipm-edt-summary-bar {
        flex-wrap: wrap;
    }

    .ipm-edt-summary-item {
        flex: 1 1 calc(33% - 4px);
        min-width: 80px;
    }

    .ipm-edt-card-header {
        flex-wrap: wrap;
    }

    .ipm-edt-card-header h3 {
        flex-basis: calc(100% - 50px);
    }

    .ipm-edt-status-label {
        margin-left: 42px;
    }

    #ipm-edt-form {
        flex-direction: column;
        align-items: stretch;
    }

    #ipm-edt-domain {
        max-width: 100%;
    }
}

/* ==========================================================================
   Settings / Guide page
   ========================================================================== */

.ipm-edt-settings-wrap {
    max-width: 960px;
}

.ipm-edt-settings-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.ipm-edt-settings-card h2 {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    padding: 0;
}

.ipm-edt-settings-card h2:not(:first-child) {
    border: none;
}

.ipm-edt-settings-card p {
    font-size: 14px;
    line-height: 1.7;
    color: #3c434a;
    margin: 0 0 12px;
}

/* Steps list */

.ipm-edt-steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ipm-edt-steps li {
    position: relative;
    padding: 14px 16px 14px 52px;
    margin-bottom: 8px;
    background: #f6f7f7;
    border-radius: 6px;
    border-left: 3px solid #2271b1;
    font-size: 14px;
    line-height: 1.6;
    color: #3c434a;
}

.ipm-edt-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 14px;
    top: 14px;
    width: 26px;
    height: 26px;
    background: #2271b1;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ipm-edt-steps li strong {
    color: #1d2327;
}

/* Checks table */

.ipm-edt-checks-table {
    margin-top: 8px;
}

.ipm-edt-checks-table th {
    font-size: 13px;
    font-weight: 600;
}

.ipm-edt-checks-table td {
    font-size: 13px;
    line-height: 1.6;
    vertical-align: top;
}

.ipm-edt-checks-table td small {
    color: #8c8f94;
}

.ipm-edt-checks-table code {
    font-size: 12px;
    word-break: break-all;
}

/* Preview box */

.ipm-edt-preview-box {
    background: #f9f9f9;
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    padding: 24px;
    margin-top: 12px;
}

/* Notes list */

.ipm-edt-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ipm-edt-notes-list li {
    position: relative;
    padding: 10px 0 10px 20px;
    font-size: 13px;
    line-height: 1.7;
    color: #3c434a;
    border-bottom: 1px solid #f0f0f1;
}

.ipm-edt-notes-list li:last-child {
    border-bottom: none;
}

.ipm-edt-notes-list li::before {
    content: "\2022";
    position: absolute;
    left: 2px;
    top: 10px;
    color: #2271b1;
    font-size: 18px;
    line-height: 1.4;
}

.ipm-edt-notes-list li strong {
    color: #1d2327;
}

/* Footer card */

.ipm-edt-settings-footer {
    background: #f6f7f7;
    text-align: center;
}

.ipm-edt-settings-footer p {
    margin: 0;
    color: #50575e;
}

.ipm-edt-settings-footer small {
    color: #8c8f94;
}

/* ==========================================================================
   Front-end shortcode overrides
   The front end has no WP admin styles, so we provide self-contained
   equivalents for buttons, notices, spinners, etc.
   ========================================================================== */

.ipm-edt-front {
    max-width: 840px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1d2327;
}

.ipm-edt-front *,
.ipm-edt-front *::before,
.ipm-edt-front *::after {
    box-sizing: border-box;
}

/* Form */
.ipm-edt-front .ipm-edt-form-container {
    border: none;
    background: #f6f7f7;
    padding: 28px 28px;
    border-radius: 10px;
}

.ipm-edt-front #ipm-edt-domain {
    border: 2px solid #c3c4c7;
    border-radius: 8px;
    font-size: 17px;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ipm-edt-front #ipm-edt-domain:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.25);
    outline: none;
}

.ipm-edt-front #ipm-edt-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.ipm-edt-front #ipm-edt-submit:hover {
    background: #135e96;
}

.ipm-edt-front #ipm-edt-submit:disabled {
    background: #a0a5aa;
    cursor: not-allowed;
}

/* Loading spinner (pure CSS, no dashicons dependency) */
.ipm-edt-front #ipm-edt-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 0;
    font-size: 15px;
    color: #50575e;
}

.ipm-edt-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #c3c4c7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: ipm-edt-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes ipm-edt-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.ipm-edt-front #ipm-edt-error {
    background: #fce8e8;
    border-left: 4px solid #d63638;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 16px 0;
    color: #8a1f1f;
    font-size: 14px;
}

.ipm-edt-front #ipm-edt-error p {
    margin: 0;
}

/* Results heading */
.ipm-edt-front #ipm-edt-results > h2 {
    font-size: 22px;
    margin: 24px 0 16px;
}

.ipm-edt-front #ipm-edt-domain-display {
    font-size: 20px;
}

/* Cards */
.ipm-edt-front .ipm-edt-card {
    border-radius: 8px;
    margin-bottom: 20px;
}

.ipm-edt-front .ipm-edt-card-header h3 {
    font-size: 16px;
}

/* Info toggle button (no WP button class) */
.ipm-edt-front .ipm-edt-info-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #2271b1;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ipm-edt-front .ipm-edt-info-toggle:hover {
    background: #e5e5e5;
    border-color: #8c8f94;
}

/* Summary bar */
.ipm-edt-front .ipm-edt-summary-bar {
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .ipm-edt-front .ipm-edt-form-container {
        padding: 20px 16px;
    }

    .ipm-edt-front #ipm-edt-form {
        flex-direction: column;
        align-items: stretch;
    }

    .ipm-edt-front #ipm-edt-domain {
        max-width: 100%;
    }

    .ipm-edt-front #ipm-edt-submit {
        width: 100%;
    }

    .ipm-edt-front .ipm-edt-summary-bar {
        flex-wrap: wrap;
    }

    .ipm-edt-front .ipm-edt-summary-item {
        flex: 1 1 calc(33% - 4px);
        min-width: 80px;
    }

    .ipm-edt-front .ipm-edt-card-header {
        flex-wrap: wrap;
    }

    .ipm-edt-front .ipm-edt-status-label {
        margin-left: 42px;
    }
}
