/* ============================================================
   TMF Membership — forms.css
   Frontend forms, OTP, multi-step, preview, payment
============================================================ */

/* ---- Base ---- */
.tmf-wrap { max-width: 860px; margin: 0 auto; padding: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.tmf-step { display: none; }
.tmf-step.active { display: block; animation: tmfFadeIn .25s ease; }
@keyframes tmfFadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ---- Cards ---- */
.tmf-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,.08); padding: 28px; margin-bottom: 16px; }
.tmf-card-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.tmf-card-header { margin-bottom: 24px; }
.tmf-card-header h2 { font-size: 22px; font-weight: 700; color: #1a1a2e; margin: 0 0 4px; }
.tmf-subtitle { color: #888; font-size: 14px; margin: 0; }

/* ---- Buttons ---- */
.tmf-btn { display: inline-block; padding: 11px 24px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all .2s; }
.tmf-btn-primary { background: #6b2c91; color: #fff; }
.tmf-btn-primary:hover { background: #5a2278; }
.tmf-btn-outline { background: transparent; color: #555; border: 1px solid #ddd; }
.tmf-btn-outline:hover { border-color: #aaa; background: #f9f9f9; }
.tmf-btn-full { width: 100%; text-align: center; }
.tmf-btn:disabled { opacity: .6; cursor: not-allowed; }
.tmf-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

/* ---- Fields ---- */
.tmf-field { margin-bottom: 16px; }
.tmf-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tmf-field-full { grid-column: 1 / -1; }
.tmf-label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.tmf-hint { font-weight: 400; color: #999; font-size: 12px; }
.tmf-hint-text { font-size: 12px; color: #999; margin: 4px 0 0; }
.tmf-input, .tmf-select, .tmf-textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; color: #222; background: #fff; transition: border .2s; }
.tmf-input:focus, .tmf-select:focus, .tmf-textarea:focus { outline: none; border-color: #6b2c91; box-shadow: 0 0 0 3px rgba(107,44,145,.1); }
.tmf-input[readonly] { background: #f5f5f5; color: #666; }
.tmf-input-large { font-size: 18px; letter-spacing: 2px; font-weight: 600; }
.tmf-input-error { border-color: #e74c3c !important; }
.tmf-textarea { resize: vertical; min-height: 72px; }
.tmf-error { font-size: 13px; color: #e74c3c; margin-top: 4px; }
.tmf-text-center { text-align: center; }

/* ---- Phone input ---- */
.tmf-phone-input-wrap { display: flex; align-items: stretch; }
.tmf-phone-prefix { padding: 10px 12px; background: #f0f0f0; border: 1px solid #ddd; border-right: none; border-radius: 8px 0 0 8px; font-size: 14px; color: #555; white-space: nowrap; }
.tmf-phone-input-wrap .tmf-input { border-radius: 0 8px 8px 0; }

/* ---- OTP Boxes ---- */
.tmf-otp-boxes { display: flex; gap: 10px; justify-content: center; margin: 20px 0 8px; }
.tmf-otp-box { width: 56px; height: 60px; text-align: center; font-size: 26px; font-weight: 700; border: 2px solid #ddd; border-radius: 10px; outline: none; transition: border .2s; }
.tmf-otp-box:focus { border-color: #6b2c91; box-shadow: 0 0 0 3px rgba(107,44,145,.15); }
.tmf-highlight { font-weight: 700; color: #6b2c91; }
.tmf-resend-wrap { text-align: center; font-size: 13px; color: #888; margin-bottom: 12px; }
.tmf-link { color: #6b2c91; cursor: pointer; text-decoration: underline; }
.tmf-timer { color: #aaa; }
.tmf-debug-hint { font-size: 12px; color: #e67e22; text-align: center; padding: 6px; background: #fef9f0; border-radius: 6px; margin-top: 8px; }

/* ---- Progress bar ---- */
.tmf-form-progress { margin-bottom: 24px; }
.tmf-progress-bar { height: 4px; background: #eee; border-radius: 2px; margin-bottom: 10px; }
.tmf-progress-fill { height: 100%; background: #6b2c91; border-radius: 2px; transition: width .3s ease; width: 0; }
.tmf-progress-steps { display: flex; justify-content: space-between; }
.tmf-ps { font-size: 11px; color: #bbb; font-weight: 500; text-align: center; flex: 1; }
.tmf-ps.active { color: #6b2c91; font-weight: 700; }
.tmf-ps.done { color: #27ae60; }

/* ---- Form sections ---- */
.tmf-form-section { display: none; }
.tmf-form-section.active { display: block; }
.tmf-section-title { font-size: 17px; font-weight: 700; color: #1a1a2e; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid #f0e8f7; }
.tmf-subsection-title { font-size: 14px; font-weight: 700; color: #6b2c91; margin: 16px 0 10px; }

/* ---- Same address checkbox ---- */
.tmf-same-address-wrap { margin: 12px 0; }
.tmf-checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: #555; }
.tmf-checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: #6b2c91; }

/* ---- File upload ---- */
.tmf-file-wrap { position: relative; }
.tmf-file-input { position: absolute; opacity: 0; width: 0; height: 0; }
.tmf-file-label { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px dashed #ddd; border-radius: 8px; cursor: pointer; font-size: 14px; color: #666; transition: border .2s; }
.tmf-file-label:hover { border-color: #6b2c91; color: #6b2c91; }
.tmf-file-icon { font-size: 20px; }
.tmf-photo-preview { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; margin-top: 8px; border: 2px solid #eee; }

/* ---- Preview ---- */
.tmf-preview-table { width: 100%; border-collapse: collapse; }
.tmf-preview-table tr:nth-child(even) { background: #fafafa; }
.tmf-preview-label { width: 40%; padding: 8px 12px; font-weight: 600; font-size: 13px; color: #555; }
.tmf-preview-table td:last-child { padding: 8px 12px; font-size: 14px; }
.tmf-fee-notice { background: #f8f4ff; border-radius: 10px; padding: 16px 20px; margin: 20px 0; }
.tmf-fee-box { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 16px; }
.tmf-fee-box strong { font-size: 22px; color: #6b2c91; }
.tmf-fee-warning { font-size: 13px; color: #e67e22; margin: 0; }

/* ---- Declaration ---- */
.tmf-declaration { background: #f9f9ff; border-left: 3px solid #6b2c91; padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 13px; color: #555; }

/* ---- Success state ---- */
.tmf-success-state { text-align: center; padding: 24px 0; }
.tmf-success-icon { width: 64px; height: 64px; border-radius: 50%; background: #eafaf1; color: #27ae60; font-size: 32px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.tmf-success-state h2 { font-size: 24px; color: #1a1a2e; margin-bottom: 12px; }
.tmf-success-state p { color: #555; font-size: 15px; margin-bottom: 10px; }
.tmf-contact-note { font-size: 14px; color: #888; margin-top: 16px; }
.tmf-new-id-box { background: #f8f4ff; border-radius: 10px; padding: 16px; margin: 16px 0; }
.tmf-new-id-label { display: block; font-size: 13px; color: #888; margin-bottom: 4px; }
.tmf-new-id-value { display: block; font-size: 26px; font-weight: 800; color: #6b2c91; letter-spacing: 2px; }

/* ---- Closed state ---- */
.tmf-closed-state { text-align: center; padding: 24px 0; }
.tmf-closed-icon { font-size: 48px; margin-bottom: 12px; }
.tmf-closed-state h2 { font-size: 22px; color: #1a1a2e; margin-bottom: 10px; }
.tmf-interest-form { margin-top: 24px; padding-top: 24px; border-top: 1px solid #eee; }
.tmf-interest-form h3 { font-size: 16px; margin-bottom: 16px; color: #444; }
.tmf-success-msg { background: #eafaf1; color: #1e8449; padding: 12px 16px; border-radius: 8px; font-size: 14px; }

/* ---- Member found box (renewal) ---- */
.tmf-member-found-box { background: #f8f4ff; border-radius: 10px; padding: 16px; text-align: center; margin: 16px 0; }
.tmf-member-found-icon { font-size: 32px; margin-bottom: 8px; }
.tmf-member-found-name { font-size: 20px; font-weight: 700; color: #1a1a2e; }
.tmf-member-found-phone { font-size: 14px; color: #666; margin-top: 4px; }
.tmf-phone-mismatch-note { font-size: 13px; color: #e67e22; background: #fef9f0; padding: 10px 14px; border-radius: 8px; margin: 12px 0; }

/* ---- Loading spinner ---- */
.tmf-loading-state { text-align: center; padding: 40px 0; }
.tmf-spinner { width: 40px; height: 40px; border: 4px solid #eee; border-top-color: #6b2c91; border-radius: 50%; animation: tmfSpin .8s linear infinite; margin: 0 auto 16px; }
@keyframes tmfSpin { to { transform: rotate(360deg); } }

/* ---- Admin login card ---- */
.tmf-admin-login-card { padding-top: 32px; }
.tmf-admin-login-logo { text-align: center; margin-bottom: 20px; }
.tmf-text-logo { font-size: 28px; font-weight: 900; color: #6b2c91; letter-spacing: 4px; }
.tmf-password-wrap { position: relative; }
.tmf-pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; }
.tmf-login-footer { text-align: center; margin-top: 20px; font-size: 13px; color: #aaa; }

/* ---- T&C content ---- */
.tmf-tnc-content { max-height: 340px; overflow-y: auto; padding: 16px; background: #f9f9f9; border-radius: 8px; border: 1px solid #eee; font-size: 14px; line-height: 1.7; color: #444; margin-bottom: 20px; }
.tmf-tnc-content ul, .tmf-tnc-content ol { padding-left: 24px; margin: 8px 0; }
.tmf-tnc-content li { margin-bottom: 6px; }
.tmf-directions-content { font-size: 15px; line-height: 1.8; color: #444; margin-bottom: 20px; }
.tmf-directions-content ul, .tmf-directions-content ol { padding-left: 24px; margin: 8px 0; list-style: disc; }
.tmf-directions-content ol { list-style: decimal; }
.tmf-directions-content li { margin-bottom: 6px; display: list-item; }
.tmf-directions-content p { margin-bottom: 10px; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .tmf-field-grid { grid-template-columns: 1fr; }
    .tmf-field-full { grid-column: 1; }
    .tmf-otp-boxes { gap: 6px; }
    .tmf-otp-box { width: 48px; height: 54px; font-size: 22px; }
    .tmf-card { padding: 18px; }
}

/* ---- Preview file thumbnails ---- */
.tmf-preview-files { display:flex; gap:20px; margin-top:16px; padding:16px; background:#f9f7fc; border-radius:10px; border:1px solid #e8e0f0; flex-wrap:wrap; }
.tmf-preview-file-item { display:flex; flex-direction:column; align-items:center; gap:8px; min-width:120px; max-width:160px; }
.tmf-preview-file-label { font-size:12px; font-weight:700; color:#6b2c91; text-transform:uppercase; letter-spacing:.5px; }
.tmf-preview-file-thumb { width:120px; height:130px; object-fit:cover; border-radius:8px; border:2px solid #6b2c91; display:block; }
.tmf-preview-file-pdf { width:120px; height:130px; background:#f0e8f7; border-radius:8px; border:2px solid #6b2c91; display:flex; align-items:center; justify-content:center; font-size:36px; }
.tmf-preview-file-missing { font-size:13px; color:#bbb; text-align:center; }
.tmf-preview-file-name { font-size:12px; color:#555; text-align:center; max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
