/* Modal chrome, shared by the dashboard and the Design Studio.
 *
 * This used to live inline in index.html, which was fine while the dashboard
 * was the only page with a modal. The Send step now has to exist in the Studio
 * too -- you dress a book and then you send it, and bouncing back to the
 * dashboard for the last click undoes the point of landing here -- so the
 * styles move out rather than getting a second hand-built copy that drifts.
 *
 * Every token below is defined in BOTH pages' palettes (the Studio copied the
 * app's block verbatim, light and dark), so this file needs no colours of its
 * own and follows the light/dark setting on whichever page loads it.
 *
 * index.html still uses .modal-overlay / .modal-card / .modal-field for its
 * review and links modals; those are the same chrome, which is why this file
 * holds the generic rules rather than only the .send-* ones. */

.modal-overlay{position:fixed;inset:0;background:rgba(13,9,5,0.95);z-index:9000;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s;}
.modal-overlay.open{opacity:1;pointer-events:all;}
.modal-card{background:var(--surface);border:1px solid var(--border-2);border-radius:4px;padding:32px 36px;max-width:440px;width:90%;position:relative;}
.modal-title{font-family:'Playfair Display',serif;font-size:20px;color:var(--cream);margin:0 0 24px;}
.modal-field{margin-bottom:16px;}
.modal-field label{display:block;font-family:'DM Sans',sans-serif;font-size:10px;font-weight:600;letter-spacing:.15em;text-transform:uppercase;color:var(--text-2);margin-bottom:6px;}
.modal-field input{width:100%;box-sizing:border-box;font-family:'DM Sans',sans-serif;font-size:14px;padding:10px 14px;background:rgba(255,255,255,.04);border:1px solid var(--border);border-radius:3px;color:var(--cream);outline:none;transition:border-color .2s;}
.modal-field input:focus{border-color:var(--gold);}
.modal-send-btn{width:100%;font-family:'DM Sans',sans-serif;font-size:12px;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:var(--ink);background:linear-gradient(135deg,var(--btn-a),var(--btn-b),#b8913e);border:none;padding:14px;border-radius:3px;cursor:pointer;transition:all .25s;margin-top:8px;}
.modal-send-btn:hover{transform:translateY(-1px);box-shadow:0 6px 24px var(--border-strong);}
.modal-send-btn:disabled{opacity:.5;cursor:not-allowed;transform:none;}
.modal-close{position:absolute;top:12px;right:16px;background:none;border:none;color:var(--text-mut);font-size:20px;cursor:pointer;padding:4px;}
.modal-close:hover{color:var(--cream);}
.modal-status{margin-top:12px;font-size:13px;font-weight:300;line-height:1.5;}
.modal-status.success{color:var(--success);}
.modal-status.error{color:var(--danger);}
.modal-warning{font-size:13px;color:var(--text-mut);line-height:1.6;padding:16px 0;}
.modal-warning a{color:var(--gold);}

.send-check{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--text-dim);margin:2px 0 14px;cursor:pointer;}
.send-check input{width:15px;height:15px;accent-color:var(--accent);cursor:pointer;}
.send-gmail-email{color:var(--gold);}
.send-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:4px;}
.modal-ghost-btn{font-family:'DM Sans',sans-serif;font-size:12px;font-weight:600;letter-spacing:.08em;color:var(--gold);background:transparent;border:1px solid var(--border-strong);border-radius:4px;padding:11px 18px;cursor:pointer;transition:all .2s;}
.modal-ghost-btn:hover{background:var(--accent-faint);border-color:var(--border-hover);}
.modal-ghost-btn:disabled{opacity:.5;cursor:not-allowed;}
.send-divider{display:flex;align-items:center;gap:12px;margin:22px 0 14px;color:var(--text-mut);font-size:11px;letter-spacing:.08em;text-transform:uppercase;}
.send-divider::before,.send-divider::after{content:'';flex:1;height:1px;background:var(--border-soft);}
.send-linkrow{display:flex;gap:8px;flex-wrap:wrap;}
.send-linkrow input{flex:1;min-width:0;background:rgba(0,0,0,.25);border:1px solid var(--border-2);border-radius:4px;color:var(--text-dim);font-size:12px;padding:10px 12px;font-family:inherit;}
@media (max-width:640px){ .send-linkrow input{flex:1 0 100%;} }

/* The success line at the top of the Send modal after a publish. */
.send-success{font-size:13px;color:var(--success);background:var(--success-bg);border:1px solid var(--success-border);border-radius:4px;padding:10px 12px;margin:0 0 18px;line-height:1.5;}

/* Phone. The dashboard already bumps .modal-status for readability inside its
 * own media query; the rest of the modal needs the same treatment, and the
 * Studio gets none of the dashboard's mobile block, so the bump lives here
 * where both pages can see it. 16px is the floor the repo's readability audit
 * enforces -- anything under it fails. */
@media (max-width:820px){
  .modal-card{padding:26px 20px;max-height:86vh;overflow-y:auto;}
  .modal-field input,.send-linkrow input,.send-check,.modal-status{font-size:16px;}
  .send-actions{flex-direction:column;align-items:stretch;}
  .send-actions .modal-send-btn,.send-actions .modal-ghost-btn{width:100%;}
}
