/* ==========================================================================
   Contributors: sign-in, account area, story editor, author box
   (loaded after site.css; uses its design tokens)
   ========================================================================== */
.auth-page { padding: clamp(48px, 7vw, 96px) 0; background: linear-gradient(180deg, var(--mist), #fff 70%); }
.auth-grid { display: grid; grid-template-columns: 1fr minmax(0, 560px); gap: clamp(32px, 6vw, 96px); align-items: start; }
.auth-intro { padding-top: 24px; }
.auth-intro .benefit-list { margin-top: 24px; }
.auth-card .form-title { margin-bottom: 20px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.auth-row .consent { margin: 0; }
.auth-switch { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: .95rem; }
.auth-switch a { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.consent.small { font-size: .88rem; margin: 8px 0 0; }
.guidelines { margin: 4px 0 20px; padding: 14px 18px; border-radius: 0; background: var(--sand); }
.guidelines summary { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); cursor: pointer; }
.guidelines ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--text); font-size: .94rem; }
.guidelines li { margin-bottom: 6px; }

/* Account header + tabs */
.account-head { padding: 40px 0 0; background: var(--mist); border-bottom: 1px solid var(--line); }
.account-head-inner { display: flex; flex-direction: column; gap: 24px; }
.account-who { display: flex; align-items: center; gap: 18px; }
.account-who .eyebrow { margin-bottom: 4px; }
.account-name { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); margin: 0; }
.account-meta { margin: 6px 0 0; }
.account-avatar { display: grid; place-items: center; flex-shrink: 0; width: 64px; height: 64px; border-radius: 0; overflow: hidden; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.2rem; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-avatar.lg { width: 88px; height: 88px; font-size: 1.6rem; }
.account-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.account-tabs a, .account-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; }
.account-tabs a:hover, .account-tabs button:hover { color: var(--primary); }
.account-tabs a.is-active { color: var(--primary); border-bottom-color: var(--accent); }
.account-tabs form { margin-left: auto; }
.account-flash { margin: 24px 0 0; }

/* Status pills */
.pill-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 0; font-size: .78rem; font-weight: 700; background: #eef1f4; color: #475467; }
.pill-status .icon { width: 14px; height: 14px; }
.pill-status.is-published { background: var(--accent-soft); color: var(--accent-dark); }
.pill-status.is-pending { background: #fff6e5; color: #9a5b00; }
.pill-status.is-rejected { background: #fdecea; color: #b42318; }

/* Dashboard */
.account-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 48px; }
.account-stat { padding: 20px 22px; border-radius: 0; background: #fff; border: 1px solid var(--line); border-top: 3px solid #cfd7df; }
.account-stat strong { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--ink); }
.account-stat span { color: var(--muted); font-size: .9rem; }
.account-stat.is-published { border-top-color: var(--accent); }
.account-stat.is-pending { border-top-color: #f0a020; }
.account-stat.is-rejected { border-top-color: #d92d20; }
.story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.story-row { display: flex; gap: 20px; align-items: flex-start; padding: 18px; border-radius: 0; background: #fff; border: 1px solid var(--line); }
.story-thumb { display: grid; place-items: center; flex: 0 0 140px; aspect-ratio: 16 / 10; border-radius: 0; overflow: hidden; background: var(--mist); color: var(--primary); }
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-main { flex: 1; min-width: 0; }
.story-title { font-size: 1.2rem; margin: 8px 0 4px; }
.story-meta { color: var(--muted); font-size: .9rem; margin: 0; }
.story-actions { display: flex; flex-direction: column; gap: 8px; }
.review-note { margin-top: 12px; padding: 12px 16px; border-radius: 0; background: var(--accent-soft); color: var(--text); font-size: .94rem; line-height: 1.6; }
.review-note strong { display: flex; align-items: center; gap: 6px; color: var(--ink); margin-bottom: 4px; }
.review-note.is-warning { background: #fff6e5; border-left: 3px solid #f0a020; }
.story-editor-main > .review-note { margin: 0 0 24px; }

/* Story editor */
.story-editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.story-editor-side { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 16px; }
.side-card { padding: 22px; border-radius: 0; background: #fff; border: 1px solid var(--line); }
.side-card .btn + .btn, .side-card .btn + a.btn { margin-top: 10px; }
.side-card > .field-hint { margin: 0 0 16px; }
.side-title { font-family: var(--font-sans); font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.side-status { margin: 0 0 10px; font-size: .92rem; }
.side-card.guidelines { margin: 0; background: var(--sand); border: 0; }
.title-field { font-family: var(--font-display); font-size: 1.5rem !important; font-weight: 600; }
.story-rte { border: 1.5px solid var(--line-strong); border-radius: 0; background: #fff; }
.story-rte.is-invalid { border-color: #dc2626; }
.story-rte:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.story-rte .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fafbfc; position: sticky; top: var(--header-h); z-index: 5; }
.story-rte .ql-container.ql-snow { border: 0; font-family: var(--font-sans); font-size: 1.08rem; }
.story-rte .ql-editor { min-height: 420px; line-height: 1.8; color: var(--ink); }
.story-rte .ql-editor img { border-radius: 0; }
.cover-field { margin-bottom: 16px; }
.cover-preview { display: grid; place-items: center; aspect-ratio: 16 / 10; margin-bottom: 10px; border-radius: 0; overflow: hidden; background: var(--mist); color: var(--muted); text-align: center; font-size: .85rem; }
.cover-preview.is-empty { gap: 6px; align-content: center; border: 1.5px dashed var(--line-strong); padding: 12px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.btn-danger-text { --btn-bg: transparent; --btn-fg: #b42318; --btn-border: transparent; }
.btn-danger-text:hover { --btn-bg: #fdecea; --btn-fg: #b42318; }

/* Profile */
.profile-hint { margin: -12px 0 24px; }
.profile-photo { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.form fieldset legend > span .icon { width: 16px; height: 16px; }

/* Public: author box, share-your-story invitations, preview banner */
.author-box { display: flex; gap: 18px; margin-top: 48px; padding: 24px; border-radius: 0; background: var(--sand); }
.author-label { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.author-name { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--ink); }
.author-role { margin: 2px 0 0; color: var(--accent-dark); font-weight: 500; font-size: .94rem; }
.author-bio { margin: 10px 0 0; color: var(--text); font-size: .98rem; line-height: 1.65; }
.share-cta { display: flex; align-items: center; gap: 20px; margin-top: 32px; padding: 22px 26px; border-radius: 0; background: var(--mist); }
.share-cta > div:first-of-type { flex: 1; }
.share-cta strong { display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.share-cta span { color: var(--muted); font-size: .96rem; }
.share-cta.is-banner { margin: 56px 0 0; border: 1px solid color-mix(in srgb, var(--accent) 25%, #fff); background: var(--accent-soft); }
.share-cta-icon { display: grid; place-items: center; flex-shrink: 0; width: 52px; height: 52px; border-radius: 0; background: var(--accent); color: #fff; }
.share-cta-icon .icon { width: 24px; height: 24px; }
.share-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-account { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); text-decoration: none; font-size: .9rem; }
.footer-account:hover { color: #fff; }
.preview-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 12px 16px; background: #fff6e5; color: #7a4800; font-size: .95rem; border-bottom: 1px solid #f5d9a8; }
.preview-banner a { font-weight: 700; }

@media (max-width: 1100px) {
    .auth-grid, .story-editor { grid-template-columns: 1fr; }
    .story-editor-side { position: static; }
    .auth-intro { padding-top: 0; }
}
@media (max-width: 760px) {
    .account-stats { grid-template-columns: 1fr 1fr; }
    .story-row { flex-direction: column; }
    .story-thumb { flex-basis: auto; width: 100%; }
    .story-actions { flex-direction: row; }
    .account-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .account-tabs a, .account-tabs button { white-space: nowrap; padding: 12px 10px; }
    .share-cta, .share-cta.is-banner { flex-direction: column; align-items: flex-start; }
    .author-box { flex-direction: column; }
}

/* Staff preview of the sign-in / registration pages */
.alert-info { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid color-mix(in srgb, var(--primary) 20%, #fff); }
.alert-info a { font-weight: 700; }
.form.is-preview { opacity: .55; pointer-events: none; user-select: none; }

/* ---------- Profile photo cropper ---------- */
.crop-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 0; background: #fff; color: var(--text); box-shadow: var(--shadow-lg); }
.crop-dialog::backdrop { background: rgba(6, 16, 34, .72); backdrop-filter: blur(3px); }
.crop-head { padding: 24px 26px 6px; }
.crop-head h2 { margin: 0 0 4px; font-size: 1.3rem; }
.crop-head p { margin: 0; font-size: .92rem; color: var(--muted); }
.crop-body { display: flex; align-items: flex-end; gap: 20px; padding: 18px 26px 6px; }
.crop-stage { position: relative; flex: 1; aspect-ratio: 1; max-width: 360px; overflow: hidden; background: #0d1626; cursor: grab; touch-action: none; user-select: none; outline: none; }
.crop-stage.is-dragging { cursor: grabbing; }
.crop-stage:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, #fff); }
.crop-stage img, .crop-round img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center; pointer-events: none; }
/* Rule-of-thirds guide and a soft round outline (the photo is often shown in a circle or square) */
.crop-grid { position: absolute; inset: 0; pointer-events: none; border: 2px solid rgba(255,255,255,.85);
    background:
        linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255,255,255,.35) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(255,255,255,.35) 0 calc(66.66% + .5px), transparent 0),
        linear-gradient(0deg, transparent calc(33.33% - .5px), rgba(255,255,255,.35) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(255,255,255,.35) 0 calc(66.66% + .5px), transparent 0); }
.crop-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.crop-side small { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.crop-round { position: relative; display: block; width: 96px; height: 96px; overflow: hidden; border-radius: 50%; background: #0d1626; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.crop-zoom { display: flex; align-items: center; gap: 12px; padding: 14px 26px 4px; }
.crop-zoom input[type=range] { flex: 1; accent-color: var(--accent); }
.crop-step { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.crop-step:hover { border-color: var(--accent); color: var(--accent); }
.crop-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px 24px; }
@media (max-width: 560px) {
    .crop-body { flex-direction: column; align-items: stretch; }
    .crop-stage { max-width: none; }
    .crop-side { flex-direction: row; justify-content: center; }
    .crop-round { width: 64px; height: 64px; }
    .crop-actions .btn { flex: 1; justify-content: center; }
}
