/* =========================================
   FC Member Directory — Frontend Styles
   Themed via fc-theme CSS variables
   ========================================= */

/* ── Form Wrap ── */
.fc-form-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: var(--fc-font-main, inherit);
}

.fc-form-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--fc-green-950, #052e16);
    border-bottom: 3px solid var(--fc-green-600, #16a34a);
    padding-bottom: 10px;
}

.fc-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--fc-green-700, #15803d);
    margin: 28px 0 14px;
    padding: 6px 14px;
    background: var(--fc-green-50, #f0fdf4);
    border-left: 4px solid var(--fc-green-600, #16a34a);
    border-radius: 0 6px 6px 0;
}

/* ── Form Grid ── */
.fc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

@media (max-width: 640px) {
    .fc-form-grid { grid-template-columns: 1fr; }
}

.fc-field { display: flex; flex-direction: column; gap: 6px; }
.fc-field-full { grid-column: 1 / -1; }

.fc-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--fc-slate-700, #374151);
}

.fc-required { color: var(--fc-red-500, #e53e3e); margin-left: 2px; }

.fc-field input,
.fc-field select,
.fc-field textarea {
    border: 1.5px solid var(--fc-slate-300, #d1d5db);
    border-radius: var(--fc-radius-sm, 8px);
    padding: 10px 14px;
    font-size: 16px; /* iOS: prevents auto-zoom on focus */
    font-size: 0.95rem;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--fc-font-main, inherit);
}

.fc-field input:focus,
.fc-field select:focus,
.fc-field textarea:focus {
    outline: none;
    border-color: var(--fc-green-600, #16a34a);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}

.fc-field textarea { resize: vertical; }

/* ── Submit Button ── */
.fc-submit-wrap { margin-top: 30px; }

.fc-submit-btn {
    background: var(--fc-green-700, #15803d);
    color: var(--fc-white, #fff);
    border: none;
    border-radius: var(--fc-radius-sm, 8px);
    padding: 13px 36px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* removes 300ms tap delay */
}
@media (max-width: 640px) {
    .fc-submit-btn {
        width: 100%;
        padding: 15px;
        font-size: 1.05rem;
    }
}

.fc-submit-btn:hover {
    background: var(--fc-green-800, #166534);
    box-shadow: var(--fc-shadow-md, 0 4px 16px rgba(0,0,0,.15));
}

.fc-submit-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ── Messages ── */
.fc-message {
    padding: 14px 18px;
    border-radius: var(--fc-radius-sm, 8px);
    margin-bottom: 20px;
    font-weight: 500;
}
.fc-success {
    background: var(--fc-green-100, #d1fae5);
    color: var(--fc-green-800, #065f46);
    border: 1px solid var(--fc-green-400, #6ee7b7);
}
.fc-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.fc-notice {
    background: var(--fc-yellow-300, #fef3c7);
    color: var(--fc-green-950, #052e16);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ── Advisor / Member Grid ── */
.fc-advisor-grid,
.fc-member-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr)!important;
    gap: 20px;
    margin-top: 16px;
}
/* Tablet */
@media (max-width: 1024px) {
    .fc-advisor-grid,
    .fc-member-grid {
        grid-template-columns: repeat(3, 1fr)!important;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .fc-advisor-grid,
    .fc-member-grid {
        grid-template-columns: repeat(2, 1fr)!important;
    }
}


/* ── Cards ── */
.fc-advisor-card,
.fc-member-card {
    background: var(--fc-white, #fff);
    border: 1px solid var(--fc-slate-200, #e5e7eb);
    border-radius: var(--fc-radius-md, 12px);
    padding: 20px;
    box-shadow: var(--fc-shadow-sm, 0 2px 8px rgba(0,0,0,0.06));
    transition: box-shadow 0.2s, transform 0.2s;
}

.fc-advisor-card:hover,
.fc-member-card:hover {
    box-shadow: var(--fc-shadow-md, 0 6px 20px rgba(0,0,0,0.1));
    transform: translateY(-2px);
}

.fc-card-id {
    display: inline-block;
    background: var(--fc-green-700, #15803d);
    color: var(--fc-white, #fff);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--fc-radius-full, 20px);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.fc-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--fc-green-950, #111827);
}

.fc-advisor-card p,
.fc-member-card p {
    font-size: 0.88rem;
    color: var(--fc-slate-500, #6b7280);
    margin: 4px 0;
}

.fc-card-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px;
    font-size: 14px;
    color: #555;
    margin: 8px 0 12px;
}

/* ── Button ── */
.fc-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 18px;
    background: var(--fc-green-700, #15803d);
    color: var(--fc-white, #fff) !important;
    border-radius: var(--fc-radius-sm, 6px);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    width: 100%;
}
.fc-btn:hover { background: var(--fc-green-800, #166534); }

/* ── Detail Page ── */
.fc-detail-wrap { max-width: 760px; margin: 0 auto; }

.fc-detail-top {
    background: var(--fc-white, #fff);
    border: 1px solid var(--fc-slate-200, #e5e7eb);
    border-radius: var(--fc-radius-md, 14px);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--fc-shadow-sm, 0 2px 10px rgba(0,0,0,0.07));
}

.fc-detail-id {
    display: inline-block;
    background: var(--fc-green-700, #15803d);
    color: var(--fc-white, #fff);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: var(--fc-radius-full, 20px);
    margin-bottom: 12px;
}

.fc-detail-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--fc-green-950, #052e16);
}

.fc-detail-top p {
    font-size: 0.95rem;
    color: var(--fc-slate-600, #4b5563);
    margin: 6px 0;
}

.fc-detail-members h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--fc-green-900, #14532d);
    border-bottom: 2px solid var(--fc-slate-200, #e5e7eb);
    padding-bottom: 10px;
}

/* ── Donation chart placeholder ── */
.fc-donation-chart-wrap {
    background: var(--fc-slate-50, #f9fafb);
    border: 1.5px dashed var(--fc-slate-300, #d1d5db);
    border-radius: var(--fc-radius-md, 12px);
    padding: 28px;
    margin-top: 20px;
    text-align: center;
    color: var(--fc-slate-400, #9ca3af);
    font-size: 0.9rem;
}

/* ── Empty / Error ── */
.fc-empty { color: var(--fc-slate-400, #9ca3af); font-style: italic; }
.fc-error { color: var(--fc-red-600, #dc2626); }

/* =========================================
   Profile Image Upload UI
   ========================================= */
.fc-upload-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.fc-upload-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px dashed var(--fc-slate-300, #d1d5db);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--fc-slate-50, #f9fafb);
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.fc-upload-preview.has-image {
    border-style: solid;
    border-color: var(--fc-green-600, #16a34a);
}

.fc-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.fc-upload-icon { font-size: 1.8rem; }
.fc-upload-text { font-size: 0.7rem; color: var(--fc-slate-400, #9ca3af); margin-top: 4px; text-align: center; }

.fc-file-input { display: none !important; }

.fc-file-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--fc-slate-100, #f3f4f6);
    border: 1.5px solid var(--fc-slate-300, #d1d5db);
    border-radius: var(--fc-radius-sm, 8px);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fc-slate-700, #374151);
    transition: background 0.2s, border-color 0.2s;
}

.fc-file-label:hover {
    background: var(--fc-slate-200, #e5e7eb);
    border-color: var(--fc-green-600, #16a34a);
}

.fc-note { font-size: 0.78rem; color: var(--fc-slate-400, #9ca3af); font-weight: 400; }

/* ── Card Images ── */
.fc-card-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    border: 2px solid var(--fc-green-400, #4ade80);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fc-slate-100, #f3f4f6);
}

.fc-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fc-card-img-placeholder {
    font-size: 2rem;
    color: var(--fc-slate-400, #9ca3af);
}

/* ── Detail Page Image ── */
.fc-detail-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--fc-green-600, #16a34a);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fc-slate-100, #f3f4f6);
}

.fc-detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fc-detail-img-placeholder {
    font-size: 3rem;
    color: var(--fc-slate-400, #9ca3af);
}

/* ── Signature preview ── */
.fc-sig-preview {
    min-height: 80px;
    border: 2px dashed var(--fc-slate-300, #d1d5db);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--fc-slate-50, #fafafa);
    font-size: 13px;
    color: var(--fc-slate-500, #6b7280);
}

/* ── Checkbox tap area (mobile) ── */
#fc_same_address {
    width: 18px;
    height: 18px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ── Field error state ── */
.fc-field.fc-field-error input,
.fc-field.fc-field-error select,
.fc-field.fc-field-error textarea {
    border-color: var(--fc-red-500, #ef4444) !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,.18) !important;
    background: #fff5f5 !important;
    animation: fc-shake 0.35s ease;
}
.fc-field.fc-field-error label {
    color: var(--fc-red-500, #e53e3e);
}
@keyframes fc-shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    60%      { transform: translateX(6px); }
}

/* ── Validation error list ── */
#fc-validation-errors ul { margin: 8px 0 0 20px; padding: 0; }
#fc-validation-errors li { margin-bottom: 3px; }

/* ── Address Block ── */
.fc-address-block {
    border: 1px solid var(--fc-slate-200, #e5e7eb);
    border-radius: var(--fc-radius-sm, 8px);
    padding: 16px;
    margin-bottom: 12px;
    background: var(--fc-slate-50, #f9fafb);
}
.fc-address-block select:disabled {
    background: var(--fc-slate-100, #f3f4f6);
    color: var(--fc-slate-400, #9ca3af);
    cursor: not-allowed;
}

/* ── Private info badge ── */
.fc-private-info {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--fc-yellow-300, #fffbeb);
    border: 1px solid var(--fc-yellow-400, #fcd34d);
    border-radius: var(--fc-radius-sm, 8px);
}
.fc-private-info h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--fc-green-950, #052e16);
}
.fc-private-badge {
    display: inline-block;
    font-size: 11px;
    background: var(--fc-yellow-300, #fef3c7);
    color: var(--fc-amber-600, #b45309);
    padding: 2px 8px;
    border-radius: var(--fc-radius-full, 20px);
    border: 1px solid var(--fc-yellow-400, #fcd34d);
    font-weight: normal;
    vertical-align: middle;
    margin-left: 6px;
}

/* ── Detail Table ── */
.fc-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.fc-detail-table th {
    text-align: left;
    padding: 6px 10px 6px 0;
    color: var(--fc-slate-500, #6b7280);
    white-space: nowrap;
    font-weight: 500;
    width: 130px;
}
.fc-detail-table td {
    padding: 6px 0;
    color: var(--fc-slate-900, #111827);
}
.fc-card-district {
    font-size: 12px;
    color: var(--fc-slate-500, #6b7280);
    margin: 2px 0;
}

/* ── Union text input disabled state ── */
input[data-field="union"]:disabled {
    background: var(--fc-slate-100, #f7f7f7);
    color: var(--fc-slate-400, #aaa);
    cursor: not-allowed;
}

/* ── Due Member Card (Advisor Detail Page) ── */
.fc-advisor-card--due {
    border: 2px solid #fca5a5;
    background: #fff7f7;
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.10);
}
.fc-advisor-card--due:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.18);
    border-color: #ef4444;
}


