/* AEC Apply Now — modal styles */

.aecan-lock { overflow: hidden; }

.aecan-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.aecan-overlay.aecan-show { display: flex; animation: aecanFade 0.18s ease-out; }
.aecan-overlay *, .aecan-overlay *::before, .aecan-overlay *::after { box-sizing: border-box; }

@keyframes aecanFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aecanPop { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

.aecan-modal {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: aecanPop 0.22s ease-out;
}
.aecan-modal.aecan-wide { max-width: 760px; }

/* Header */
.aecan-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-radius: 20px 20px 0 0;
}
.aecan-title { font-size: 19px; font-weight: 700; line-height: 1.2; }
.aecan-sub { font-size: 12.5px; opacity: 0.85; margin-top: 2px; }
.aecan-x {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}
.aecan-x:hover { background: rgba(255, 255, 255, 0.32); }

.aecan-body { padding: 20px 22px 24px; }

/* Choice cards */
.aecan-choices { display: flex; flex-direction: column; gap: 12px; }
.aecan-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.aecan-choice:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}
.aecan-cicon {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    font-size: 26px;
    background: #eef2ff;
    border-radius: 14px;
}
.aecan-ctxt { flex: 1 1 auto; min-width: 0; }
.aecan-ctxt b { display: block; font-size: 16px; color: #111827; }
.aecan-ctxt small { display: block; font-size: 12.5px; color: #6b7280; margin-top: 2px; }
.aecan-arrow { flex: 0 0 auto; font-size: 26px; color: #9ca3af; }

.aecan-admin-entry { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #d1d5db; }
.aecan-choice-admin { background: #fafaf9; }
.aecan-choice-admin .aecan-cicon { background: #fef3c7; }

.aecan-badge {
    display: none;
    position: absolute;
    top: -7px;
    right: -7px;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    background: #ef4444;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 999px;
    border: 2px solid #fff;
}

/* Back bar */
.aecan-back { margin-bottom: 14px; }
.aecan-backbtn {
    border: 0;
    background: #f3f4f6;
    color: #374151;
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s;
}
.aecan-backbtn:hover { background: #e5e7eb; }

/* Forms */
.aecan-form { display: flex; flex-direction: column; gap: 13px; }
.aecan-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.aecan-form input,
.aecan-form select {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 11px 12px;
    font-size: 14.5px;
    color: #111827;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.aecan-form input:focus,
.aecan-form select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.aecan-file input[type="file"] { display: none; }
.aecan-file-ui {
    display: block;
    margin-top: 5px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4f46e5;
    background: #eef2ff;
    border: 1.5px dashed #a5b4fc;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s;
}
.aecan-file-ui:hover { background: #e0e7ff; }

.aecan-hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; }

.aecan-err { min-height: 18px; font-size: 13px; font-weight: 600; color: #dc2626; }

.aecan-submit {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.aecan-submit:hover { opacity: 0.92; transform: translateY(-1px); }
.aecan-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Success */
.aecan-success { text-align: center; padding: 8px 4px 4px; }
.aecan-success-icon { font-size: 52px; margin-bottom: 8px; }
.aecan-success p { font-size: 15.5px; color: #374151; line-height: 1.55; margin: 0 0 18px; }

/* Admin: tabs */
.aecan-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.aecan-tab {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 8px;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    font-size: 13.5px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s;
}
.aecan-tab-on {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #4338ca;
}
.aecan-tabbadge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
}

/* Admin: list */
.aecan-list { display: flex; flex-direction: column; gap: 8px; }
.aecan-loading { padding: 26px 10px; text-align: center; color: #6b7280; font-size: 14px; }
.aecan-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}
.aecan-row:hover { border-color: #a5b4fc; background: #fafaff; }
.aecan-row-txt { flex: 1 1 auto; min-width: 0; }
.aecan-row-txt b { display: block; font-size: 14.5px; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aecan-row-txt small { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }

/* Status chips */
.aecan-chip {
    flex: 0 0 auto;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.aecan-chip-new { background: #fee2e2; color: #b91c1c; }
.aecan-chip-seen { background: #f3f4f6; color: #4b5563; }
.aecan-chip-good { background: #dcfce7; color: #15803d; }
.aecan-chip-bad { background: #111827; color: #f9fafb; }

/* Admin: detail */
.aecan-detail { display: flex; flex-direction: column; gap: 12px; }
.aecan-field small {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
.aecan-field div { font-size: 15px; color: #111827; word-break: break-word; }
.aecan-field a { color: #4f46e5; text-decoration: none; font-weight: 600; }
.aecan-field a:hover { text-decoration: underline; }
.aecan-detail-status { padding-top: 4px; font-size: 13.5px; font-weight: 600; color: #374151; }

.aecan-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 6px; }
.aecan-act {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
}
.aecan-act:hover { opacity: 0.88; text-decoration: none; }
.aecan-act-dl { background: #4f46e5; color: #fff; }
.aecan-act-good { background: #16a34a; color: #fff; }
.aecan-act-bad { background: #dc2626; color: #fff; }

/* Shortcode trigger button */
.aecan-trigger {
    display: inline-block;
    padding: 12px 26px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.aecan-trigger:hover { opacity: 0.92; transform: translateY(-1px); }

/* Mobile */
@media (max-width: 560px) {
    .aecan-overlay { padding: 10px; align-items: flex-end; }
    .aecan-modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
    .aecan-head { border-radius: 18px 18px 0 0; padding: 15px 18px; }
    .aecan-body { padding: 16px 16px 22px; }
    .aecan-tab { font-size: 12.5px; padding: 9px 6px; }
    .aecan-actions .aecan-act { flex: 1 1 auto; justify-content: center; }
}
