/* ==========================================================================
   AT Membership Manager v1.3.0 — Frontend Styles
   Author: Altechmind Technologies (OPC) Pvt. Ltd.
   ========================================================================== */

/* --- Variables --- */
.atmm-w,
.atmm-dir {
    --m1: #1126c5;
    --m2: #0e1f9a;
    --m3: #2563eb;
    --m4: #d4a843;
    --mbg: #f4f6fb;
    --mw: #ffffff;
    --mt: #1e293b;
    --mm: #64748b;
    --mb: #d6dce8;
    --ml: #eaeffc;
    --mr: 10px;
}

/* --- Reset for plugin scope --- */
.atmm-w,
.atmm-w *,
.atmm-w *::before,
.atmm-w *::after,
.atmm-dir,
.atmm-dir *,
.atmm-dir *::before,
.atmm-dir *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Wrapper --- */
.atmm-w {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--mt);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   SUCCESS STATE
   ========================================================================== */
.atmm-done {
    text-align: center;
    padding: 48px 24px;
    background: var(--mw);
    border: 2px solid #bbf7d0;
    border-radius: var(--mr);
    box-shadow: 0 2px 12px rgba(22, 163, 74, 0.06);
}
.atmm-done h2 {
    margin: 14px 0 8px;
    font-size: 1.25em;
    font-weight: 700;
    color: #166534;
}
.atmm-done p {
    margin: 0 auto;
    max-width: 440px;
    font-size: 0.9em;
    color: var(--mm);
    line-height: 1.6;
}
@keyframes atmm-d { from { stroke-dashoffset: 164; } to { stroke-dashoffset: 0; } }
@keyframes atmm-t { 0% { stroke-dashoffset: 36; opacity: 0; } 60% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
.atmm-circ { animation: atmm-d 0.7s ease forwards; }
.atmm-tick { stroke-dasharray: 36; stroke-dashoffset: 36; animation: atmm-t 0.5s 0.4s ease forwards; }

/* ==========================================================================
   PAYMENT CARD
   ========================================================================== */
.atmm-pay {
    background: var(--mw);
    border: 1px solid var(--mb);
    border-radius: var(--mr);
    padding: 22px 24px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(17, 38, 197, 0.04);
}

/* Step badge (shared by payment + form) */
.atmm-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.atmm-sn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--m2), var(--m1));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    line-height: 1;
}
.atmm-step strong {
    font-size: 0.95em;
    color: var(--m2);
    display: block;
}
.atmm-sub {
    font-size: 0.82em;
    color: var(--mm);
    display: block;
    margin-top: 2px;
}
.atmm-hl {
    color: var(--m1);
    font-size: 1.05em;
}

/* Payment columns */
.atmm-pay-cols {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.atmm-pay-col {
    flex: 1;
    min-width: 220px;
}
.atmm-pay-lbl {
    display: block;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--mm);
    margin-bottom: 10px;
}

/* QR */
.atmm-qr {
    background: #fff;
    border: 1px solid var(--mb);
    border-radius: 8px;
    padding: 8px;
    display: inline-block;
}
.atmm-qr img {
    display: block;
    max-width: 160px;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* UPI row */
.atmm-upi {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--ml);
    border-radius: 6px;
    font-size: 0.84em;
    display: flex;
    gap: 6px;
    align-items: center;
}
.atmm-upi span { color: var(--mm); }
.atmm-upi b { color: var(--m1); word-break: break-all; }

/* Bank rows */
.atmm-bk > div {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #edf0f7;
    font-size: 0.85em;
}
.atmm-bk > div:last-child { border-bottom: none; }
.atmm-bk span { color: var(--mm); }
.atmm-bk b { color: var(--mt); text-align: right; }
.atmm-mn {
    font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    letter-spacing: 0.4px;
}

/* ==========================================================================
   FORM CARD
   ========================================================================== */
.atmm-fc {
    background: var(--mw);
    border: 1px solid var(--mb);
    border-radius: var(--mr);
    padding: 22px 24px 24px;
    box-shadow: 0 1px 4px rgba(17, 38, 197, 0.04);
}

/* Errors */
.atmm-errs { margin: 0 0 14px; }
.atmm-err {
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.84em;
    margin-bottom: 6px;
}

/* Form grid */
.atmm-form { margin-top: 20px; }
.atmm-g {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
}
.atmm-full {
    grid-column: 1 / -1 !important;
}

/* Labels */
.atmm-w label,
.atmm-fc label {
    display: block !important;
    font-size: 0.82em !important;
    font-weight: 600 !important;
    color: var(--mt) !important;
    margin-bottom: 4px !important;
    padding: 0 !important;
}
.atmm-r { color: #dc2626; }
.atmm-opt {
    font-weight: 400 !important;
    color: var(--mm) !important;
    font-size: 0.9em !important;
}

/* Inputs */
.atmm-w input[type="text"],
.atmm-w input[type="email"],
.atmm-w input[type="tel"],
.atmm-w input[type="date"],
.atmm-w textarea,
.atmm-fc input[type="text"],
.atmm-fc input[type="email"],
.atmm-fc input[type="tel"],
.atmm-fc input[type="date"],
.atmm-fc textarea {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid var(--mb) !important;
    border-radius: 8px !important;
    font-size: 0.9em !important;
    background: #fff !important;
    color: var(--mt) !important;
    transition: border 0.2s, box-shadow 0.2s !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: auto !important;
    max-width: 100% !important;
}
.atmm-w input:focus,
.atmm-w textarea:focus,
.atmm-fc input:focus,
.atmm-fc textarea:focus {
    outline: none !important;
    border-color: var(--m3) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}
.atmm-w textarea,
.atmm-fc textarea {
    resize: vertical !important;
}

/* File upload zone */
.atmm-drop {
    position: relative;
    border: 2px dashed var(--mb) !important;
    border-radius: 8px !important;
    padding: 16px !important;
    text-align: center;
    cursor: pointer;
    background: var(--mbg) !important;
    transition: border 0.2s, background 0.2s;
}
.atmm-drop:hover,
.atmm-drop.dg {
    border-color: var(--m3) !important;
    background: #dbeafe !important;
}
.atmm-drop input[type="file"] {
    position: absolute !important;
    inset: 0;
    opacity: 0 !important;
    cursor: pointer;
    width: 100% !important;
    height: 100% !important;
}
.atmm-drop-lbl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--mm);
    font-size: 0.82em;
    pointer-events: none;
}
.atmm-drop-pv {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.atmm-drop-pv img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid var(--m3);
}
.atmm-drop-pv span {
    font-size: 0.84em;
    color: var(--mt);
}
.atmm-frm {
    pointer-events: auto;
    background: #fee2e2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
    border-radius: 50% !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 14px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    line-height: 1;
}

/* Divider */
.atmm-div {
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
}
.atmm-div::before,
.atmm-div::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--mb);
}
.atmm-div span {
    font-size: 0.74em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--m4);
    white-space: nowrap;
}

/* Submit */
.atmm-foot {
    margin-top: 24px;
    text-align: center;
}
.atmm-btn {
    display: inline-flex !important;
    align-items: center;
    padding: 13px 36px !important;
    background: linear-gradient(135deg, var(--m2), var(--m1)) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 3px 12px rgba(17, 38, 197, 0.18);
    font-family: inherit;
    line-height: 1.4;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.atmm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(17, 38, 197, 0.28);
    color: #fff !important;
}
.atmm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.atmm-note {
    margin-top: 10px;
    font-size: 0.74em;
    color: var(--mm);
}

/* ==========================================================================
   LIFE MEMBERS DIRECTORY — Compact Horizontal Cards
   ========================================================================== */
.atmm-dir {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--mt);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Directory header */
.atmm-dir-hd {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.atmm-cnt {
    display: inline-block;
    padding: 3px 12px;
    background: var(--ml);
    color: var(--m1);
    border-radius: 16px;
    font-size: 0.78em;
    font-weight: 600;
}

/* Search */
.atmm-sbox {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid var(--mb) !important;
    border-radius: 8px;
}
.atmm-sbox:focus-within {
    border-color: var(--m3) !important;
}
.atmm-sbox input[type="search"] {
    border: none !important;
    outline: none !important;
    font-size: 0.84em !important;
    background: transparent !important;
    min-width: 150px;
    font-family: inherit;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    height: auto !important;
}

/* Empty state */
.atmm-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--mm);
}

/* Cards grid — 2 columns desktop, 1 mobile */
.atmm-cds {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
}

/* Card — compact horizontal layout */
.atmm-cd {
    background: #fff !important;
    border: 1px solid var(--mb) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    transition: box-shadow 0.2s;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 14px 16px !important;
    gap: 14px !important;
}
.atmm-cd:hover {
    box-shadow: 0 4px 16px rgba(17, 38, 197, 0.08);
}

/* Card circular photo */
.atmm-cd-photo {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    overflow: hidden !important;
    background: var(--mbg) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    border: 2px solid var(--m1) !important;
    flex-shrink: 0 !important;
}
.atmm-cd-photo img {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 50% !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.atmm-cd-av {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Card info — text side */
.atmm-cd-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}
.atmm-cd-nm {
    margin: 0 0 1px !important;
    padding: 0 !important;
    font-size: 0.92em !important;
    font-weight: 700 !important;
    color: var(--mt) !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.atmm-cd-dg {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.8em !important;
    color: var(--m4) !important;
    font-weight: 600;
    line-height: 1.3 !important;
}
.atmm-cd-pf {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.78em !important;
    color: var(--mm) !important;
    line-height: 1.3 !important;
}
.atmm-cd-mid {
    display: inline-block;
    padding: 1px 8px;
    background: var(--ml);
    color: var(--m1) !important;
    border-radius: 10px;
    font-size: 0.65em;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-top: 4px;
    align-self: flex-start;
    text-decoration: none !important;
}
.atmm-cd-mt {
    margin: 2px 0 0 !important;
    padding: 0 !important;
    font-size: 0.76em !important;
    color: var(--mm) !important;
    word-break: break-word;
    line-height: 1.3 !important;
}

/* Pagination */
.atmm-pgr {
    display: flex !important;
    justify-content: center;
    gap: 5px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.atmm-pg {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px !important;
    border: 1px solid var(--mb) !important;
    background: #fff !important;
    color: var(--mt) !important;
    font-size: 0.84em;
    text-decoration: none !important;
    transition: all 0.2s;
}
.atmm-pg:hover {
    border-color: var(--m3) !important;
    color: var(--m3) !important;
}
.atmm-pg.on {
    background: var(--m1) !important;
    color: #fff !important;
    border-color: var(--m1) !important;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .atmm-g {
        grid-template-columns: 1fr !important;
    }
    .atmm-pay-cols {
        flex-direction: column;
    }
    .atmm-dir-hd {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .atmm-sbox {
        width: 100%;
    }
    .atmm-sbox input[type="search"] {
        width: 100% !important;
        min-width: unset !important;
    }
    .atmm-cds {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .atmm-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .atmm-pay,
    .atmm-fc {
        padding: 16px 14px 18px;
    }
    .atmm-cd {
        padding: 12px 14px !important;
        gap: 12px !important;
    }
    .atmm-cd-photo {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }
    .atmm-cd-photo img {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }
}
