/* ============================================================
   AI Email Campaign Generator — Frontend Shortcode Styles
   Design: Clean editorial / refined utility
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ---------- Root tokens ---------- */
.aecg-app {
    --c-bg:        #FAFAF8;
    --c-surface:   #FFFFFF;
    --c-border:    #E4E2DC;
    --c-ink:       #1C1917;
    --c-muted:     #78716C;
    --c-accent:    #2563EB;
    --c-accent-lt: #EFF6FF;
    --c-nurture:   #D1FAE5;
    --c-nurture-t: #065F46;
    --c-sales:     #FEE2E2;
    --c-sales-t:   #991B1B;
    --c-success:   #059669;
    --radius:      12px;
    --radius-sm:   7px;
    --font-head:   'DM Serif Display', Georgia, serif;
    --font-body:   'DM Sans', system-ui, sans-serif;
    --shadow:      0 2px 12px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.10);

    font-family:   var(--font-body);
    color:         var(--c-ink);
    background:    var(--c-bg);
    max-width:     780px;
    margin:        0 auto;
    padding:       8px 0 48px;
    line-height:   1.6;
}

/* ---------- Utility ---------- */
.aecg-hidden { display: none !important; }

/* ---------- Panels ---------- */
.aecg-panel {
    background:    var(--c-surface);
    border:        1px solid var(--c-border);
    border-radius: var(--radius);
    padding:       36px 40px;
    box-shadow:    var(--shadow);
}
@media (max-width: 600px) {
    .aecg-panel { padding: 24px 20px; }
}

/* ---------- App Header ---------- */
.aecg-app-header {
    display:       flex;
    align-items:   center;
    gap:           16px;
    margin-bottom: 32px;
    padding-bottom:24px;
    border-bottom: 1px solid var(--c-border);
}
.aecg-app-header-icon {
    width:           52px;
    height:          52px;
    background:      var(--c-accent-lt);
    color:           var(--c-accent);
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       24px;
    flex-shrink:     0;
}
.aecg-app-title {
    font-family:   var(--font-head);
    font-size:     22px;
    font-weight:   400;
    margin:        0 0 2px;
    color:         var(--c-ink);
    line-height:   1.2;
}
.aecg-app-subtitle {
    font-size:  13px;
    color:      var(--c-muted);
    margin:     0;
    font-weight:300;
}

/* ---------- Form Blocks ---------- */
.aecg-block {
    margin-bottom: 28px;
}
.aecg-block-label {
    font-size:     12px;
    font-weight:   600;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:         var(--c-muted);
    margin-bottom: 10px;
}
.aecg-range-note {
    font-weight:   400;
    text-transform:none;
    letter-spacing:0;
    opacity:       .7;
}
.aecg-hint {
    font-size:   12px;
    color:       var(--c-muted);
    margin-top:  6px;
    font-weight: 300;
}

/* ---------- Text Input ---------- */
.aecg-text-input {
    width:        100%;
    box-sizing:   border-box;
    padding:      11px 14px;
    border:       1.5px solid var(--c-border);
    border-radius:var(--radius-sm);
    font-family:  var(--font-body);
    font-size:    15px;
    color:        var(--c-ink);
    background:   var(--c-surface);
    transition:   border-color .15s, box-shadow .15s;
    outline:      none;
}
.aecg-text-input::placeholder { color: var(--c-muted); opacity: .6; }
.aecg-text-input:focus {
    border-color: var(--c-accent);
    box-shadow:   0 0 0 3px rgba(37,99,235,.12);
}

/* ---------- Stepper ---------- */
.aecg-stepper {
    display:     flex;
    align-items: center;
    gap:         0;
    width:       fit-content;
    border:      1.5px solid var(--c-border);
    border-radius:var(--radius-sm);
    overflow:    hidden;
}
.aecg-step-btn {
    width:       40px;
    height:      40px;
    background:  #F5F4F1;
    border:      none;
    cursor:      pointer;
    font-size:   20px;
    line-height: 1;
    color:       var(--c-muted);
    transition:  background .15s, color .15s;
    display:     flex;
    align-items: center;
    justify-content: center;
}
.aecg-step-btn:hover { background: var(--c-accent-lt); color: var(--c-accent); }
.aecg-step-val {
    min-width:   48px;
    text-align:  center;
    font-size:   18px;
    font-weight: 600;
    padding:     0 4px;
    user-select: none;
}

/* ---------- Pill Radios ---------- */
.aecg-radio-row {
    display: flex;
    gap:     8px;
    flex-wrap: wrap;
}
.aecg-pill-label { cursor: pointer; }
.aecg-pill-label input[type="radio"] { display: none; }
.aecg-pill-label span {
    display:       flex;
    align-items:   center;
    justify-content:center;
    width:         44px;
    height:        44px;
    border:        1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size:     17px;
    font-weight:   600;
    color:         var(--c-muted);
    background:    #F5F4F1;
    transition:    all .15s;
}
.aecg-pill-label input[type="radio"]:checked + span {
    background:   var(--c-accent);
    border-color: var(--c-accent);
    color:        #fff;
    box-shadow:   0 2px 8px rgba(37,99,235,.3);
}
.aecg-pill-label input[type="radio"]:disabled + span {
    background:   #E8E6E1;
    border-color: #D4D2CC;
    color:        #A09E98;
    cursor:       not-allowed;
}

/* ---------- Frequency Grid ---------- */
.aecg-freq-grid {
    display:     flex;
    align-items: flex-start;
    gap:         20px;
}
.aecg-freq-col { flex: 1; }
.aecg-freq-title {
    font-size:     12px;
    font-weight:   600;
    text-transform:uppercase;
    letter-spacing:.06em;
    color:         var(--c-muted);
    margin-bottom: 8px;
}
.aecg-freq-divider {
    padding-top:  32px;
    font-size:    12px;
    font-weight:  500;
    color:        var(--c-muted);
    white-space:  nowrap;
    flex-shrink:  0;
}

/* ---------- Sequence strip ---------- */
.aecg-sequence-strip {
    display:    flex;
    flex-wrap:  wrap;
    gap:        6px;
    margin-top: 14px;
}
.aecg-sq-badge {
    padding:       4px 10px;
    border-radius: 20px;
    font-size:     11px;
    font-weight:   600;
    letter-spacing:.04em;
}
.aecg-sq-badge.n { background: var(--c-nurture); color: var(--c-nurture-t); }
.aecg-sq-badge.s { background: var(--c-sales);   color: var(--c-sales-t); }
.aecg-sq-times {
    font-size:  11px;
    color:      var(--c-muted);
    align-self: center;
    font-style: italic;
}

/* ---------- Options Grid ---------- */
.aecg-options-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap:                   16px;
}
@media (max-width: 580px) {
    .aecg-options-grid { grid-template-columns: 1fr; }
}
.aecg-option-col {}
.aecg-select-label {
    display:      block;
    font-size:    12px;
    font-weight:  500;
    color:        var(--c-muted);
    margin-bottom:6px;
}
.aecg-select {
    width:        100%;
    padding:      9px 12px;
    border:       1.5px solid var(--c-border);
    border-radius:var(--radius-sm);
    font-family:  var(--font-body);
    font-size:    14px;
    color:        var(--c-ink);
    background:   var(--c-surface);
    appearance:   none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2378716C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor:        pointer;
    transition:    border-color .15s;
}
.aecg-select:focus { border-color: var(--c-accent); outline: none; }

/* ---------- Summary ---------- */
.aecg-summary {
    background:    var(--c-accent-lt);
    border:        1px solid #BFDBFE;
    border-radius: var(--radius-sm);
    padding:       12px 16px;
    font-size:     13.5px;
    color:         #1E40AF;
    display:       flex;
    align-items:   center;
    gap:           10px;
    margin-bottom: 24px;
}
.aecg-summary-icon { font-size: 16px; flex-shrink: 0; }

/* ---------- Submit ---------- */
.aecg-submit-row { display: flex; }
.aecg-submit-btn {
    display:       inline-flex;
    align-items:   center;
    gap:           8px;
    padding:       13px 28px;
    background:    var(--c-accent);
    color:         #fff;
    border:        none;
    border-radius: var(--radius-sm);
    font-family:   var(--font-body);
    font-size:     15px;
    font-weight:   600;
    cursor:        pointer;
    text-decoration: none;
    transition:    background .15s, transform .1s, box-shadow .15s;
    box-shadow:    0 2px 8px rgba(37,99,235,.25);
}
.aecg-submit-btn:hover {
    background:  #1D4ED8;
    box-shadow:  0 4px 16px rgba(37,99,235,.35);
    color:       #fff;
}
.aecg-submit-btn:active { transform: translateY(1px); }
.aecg-submit-btn:disabled { opacity: .55; cursor: not-allowed; }
.aecg-btn-icon { font-size: 16px; }

.aecg-outline-btn {
    display:       inline-flex;
    align-items:   center;
    gap:           6px;
    padding:       13px 22px;
    background:    transparent;
    color:         var(--c-accent);
    border:        1.5px solid var(--c-accent);
    border-radius: var(--radius-sm);
    font-family:   var(--font-body);
    font-size:     15px;
    font-weight:   600;
    cursor:        pointer;
    transition:    background .15s;
}
.aecg-outline-btn:hover { background: var(--c-accent-lt); }

/* ---------- Progress panel ---------- */
.aecg-progress-header {
    display:       flex;
    align-items:   center;
    gap:           18px;
    margin-bottom: 24px;
}
.aecg-spinner {
    width:        36px;
    height:       36px;
    border:       3px solid #E0E7FF;
    border-top-color: var(--c-accent);
    border-radius:50%;
    animation:    aecg-spin .7s linear infinite;
    flex-shrink:  0;
}
@keyframes aecg-spin { to { transform: rotate(360deg); } }

.aecg-progress-track {
    height:        8px;
    background:    #E5E7EB;
    border-radius: 99px;
    overflow:      hidden;
    margin-bottom: 12px;
}
.aecg-progress-fill {
    height:     100%;
    background: linear-gradient(90deg, var(--c-accent), #60A5FA);
    border-radius: 99px;
    transition: width .5s ease;
}

.aecg-log {
    max-height:  220px;
    overflow-y:  auto;
    background:  #F8FAFC;
    border:      1px solid var(--c-border);
    border-radius:var(--radius-sm);
    padding:     12px 16px;
    font-size:   13px;
    line-height: 1.9;
    margin-top:  16px;
}
.aecg-log-n { color: var(--c-nurture-t); }
.aecg-log-s { color: var(--c-sales-t);   }

/* ---------- Results panel ---------- */
.aecg-result-hero {
    text-align:    center;
    padding:       16px 0 28px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 28px;
}
.aecg-result-check {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           60px;
    height:          60px;
    background:      #D1FAE5;
    color:           var(--c-success);
    border-radius:   50%;
    font-size:       28px;
    font-weight:     700;
    margin-bottom:   14px;
}
.aecg-result-title {
    font-family:   var(--font-head);
    font-size:     26px;
    font-weight:   400;
    margin:        0 0 6px;
}
.aecg-result-sub { color: var(--c-muted); font-size: 14px; margin: 0; }

.aecg-result-actions {
    display:       flex;
    gap:           12px;
    margin-bottom: 32px;
    flex-wrap:     wrap;
}
.aecg-download-btn { background: var(--c-success); box-shadow: 0 2px 8px rgba(5,150,105,.25); }
.aecg-download-btn:hover { background: #047857; color: #fff; box-shadow: 0 4px 16px rgba(5,150,105,.35); }

/* ---------- Email preview ---------- */
.aecg-preview { display: flex; flex-direction: column; gap: 14px; }
.aecg-email-card {
    border:        1px solid var(--c-border);
    border-radius: var(--radius-sm);
    overflow:      hidden;
}
.aecg-email-card-head {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         10px 16px;
    background:      #F8FAFC;
    border-bottom:   1px solid var(--c-border);
    font-size:       12px;
    font-weight:     600;
    gap:             10px;
}
.aecg-email-num { color: var(--c-muted); font-weight: 400; }
.aecg-type-badge {
    padding:       2px 8px;
    border-radius: 20px;
    font-size:     10px;
    font-weight:   700;
    letter-spacing:.05em;
    text-transform:uppercase;
}
.aecg-type-badge.n { background: var(--c-nurture); color: var(--c-nurture-t); }
.aecg-type-badge.s { background: var(--c-sales);   color: var(--c-sales-t); }

.aecg-email-card-body { padding: 14px 16px; }
.aecg-email-subject {
    font-weight:   600;
    font-size:     14px;
    margin-bottom: 6px;
    color:         var(--c-ink);
}
.aecg-email-body-text {
    font-size:   13px;
    color:       var(--c-muted);
    line-height: 1.7;
    white-space: pre-wrap;
}
