/* LeaseFinch shared styles (web and mobile). Colors come from the MudBlazor palette variables so light and dark both work. */

html, body { height: 100%; }
body { margin: 0; -webkit-tap-highlight-color: transparent; }

/* Logo */
.lf-logo { display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.lf-logo-name { font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; color: var(--mud-palette-text-primary); }
.lf-logo-accent { color: var(--mud-palette-primary); }
.lf-logo-lg .lf-logo-name { font-size: 1.9rem; }

/* App chrome */
.lf-appbar { border-bottom: 1px solid var(--mud-palette-lines-default); }
.lf-drawer { border-right: 1px solid var(--mud-palette-lines-default); }
.lf-drawer-footer { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; }
.lf-avatar-button { display: inline-flex; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.lf-avatar-button:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.lf-tab { color: var(--mud-palette-text-secondary) !important; }
.lf-tab-active { color: var(--mud-palette-primary) !important; font-weight: 600 !important; }

/* Portal bottom navigation (phones and the mobile app) */
.lf-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; height: 60px; padding-bottom: env(safe-area-inset-bottom);
    background: var(--mud-palette-surface); border-top: 1px solid var(--mud-palette-lines-default); justify-content: space-around; align-items: stretch; }
.lf-bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--mud-palette-text-secondary); text-decoration: none; font-size: .7rem; }
.lf-bottom-nav-item.active { color: var(--mud-palette-primary); font-weight: 600; }
@media (max-width: 599.98px) { .lf-portal-main { padding-bottom: calc(68px + env(safe-area-inset-bottom)); } }

/* Money */
.lf-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lf-owed { color: var(--mud-palette-error); }
.lf-credit { color: var(--mud-palette-success); }

/* Cards and lists */
.lf-card-link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.lf-card-link:hover { border-color: var(--mud-palette-primary) !important; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.lf-archived { opacity: .7; }
.cursor-pointer { cursor: pointer; }
.lf-stat { height: 100%; }
.lf-empty { border-style: dashed !important; }
.lf-dropzone { cursor: pointer; border-style: dashed !important; }
.lf-dropzone:hover { border-color: var(--mud-palette-primary) !important; }
.lf-terms th { width: 200px; text-align: left; color: var(--mud-palette-text-secondary); font-weight: 500; vertical-align: top; }
.lf-balance { padding: 16px; border-radius: var(--mud-default-borderradius); background: var(--mud-palette-background-gray); }

/* Getting started */
.lf-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.lf-step { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius); }
.lf-step-number { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); font-weight: 600; font-size: .85rem; }

/* Sign-in code */
.code-input input { font-size: 1.6rem !important; letter-spacing: .5rem; text-align: center; font-variant-numeric: tabular-nums; }

/* Browser autofill: Chrome/Edge/Safari paint autofilled inputs pale yellow/blue and ignore `background`. Cover it with an
   inset shadow in the field's own color, and delay the browser's background change so it never shows. */
.mud-input input:-webkit-autofill,
.mud-input input:-webkit-autofill:hover,
.mud-input input:-webkit-autofill:focus,
.mud-input input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset !important;
    box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset !important;
    -webkit-text-fill-color: var(--mud-palette-text-primary) !important;
    caret-color: var(--mud-palette-text-primary);
    border-radius: var(--mud-default-borderradius);
    transition: background-color 99999s ease-out 0s;
}

/* Date picker popups: size to the calendar, not to the (narrow) input they open from. */
.mud-picker-popover-paper { max-width: none !important; min-width: max-content !important; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000; padding: 12px 20px; background: #fdecea; color: #611a15;
    box-shadow: 0 -1px 4px rgba(0,0,0,.2); font-family: Inter, Segoe UI, sans-serif; }
#blazor-error-ui .reload { margin-left: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }

/* Shown until the app has loaded (before MudBlazor styles apply). */
.lf-loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    font-family: Inter, Segoe UI, sans-serif; background: #F6F7F4; }
.lf-loading-mark { font-size: 28px; font-weight: 700; color: #1F2933; }
.lf-loading-mark span { color: #1F6F5C; }
.lf-loading-bar { width: 160px; height: 4px; border-radius: 2px; background: #dbe5df; overflow: hidden; }
.lf-loading-bar span { display: block; width: 40%; height: 100%; background: #1F6F5C; animation: lf-load 1.1s ease-in-out infinite; }
@keyframes lf-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@media (prefers-color-scheme: dark) {
    .lf-loading { background: #0F1513; }
    .lf-loading-mark { color: #E6EDEA; }
    .lf-loading-mark span, .lf-loading-bar span { color: #5FC4A8; background: #5FC4A8; }
    .lf-loading-bar { background: #22302b; }
}

/* Maintenance: photo grid and request timeline */
.lf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.lf-photo { position: relative; aspect-ratio: 1; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius); overflow: hidden; }
.lf-photo-open { width: 100%; height: 100%; padding: 0; border: 0; background: var(--mud-palette-background-gray); cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: inherit; font: inherit; }
.lf-photo-open:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -2px; }
.lf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lf-photo-name { font-size: .7rem; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-photo-badge { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 8px; font-size: .65rem;
    background: var(--mud-palette-warning); color: var(--mud-palette-warning-text); }
.lf-photo-delete { position: absolute !important; top: 2px; right: 2px; background: var(--mud-palette-surface) !important; }
.lf-timeline { display: flex; flex-direction: column; gap: 10px; }
.lf-message { padding: 10px 12px; border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius); }
.lf-message-tenant { background: var(--mud-palette-background-gray); }
.lf-message-internal { border-style: dashed; border-color: var(--mud-palette-warning); }
.lf-event { display: flex; align-items: center; gap: 8px; padding: 0 4px; color: var(--mud-palette-text-secondary); }

/* Documents written in the app (composed documents and templates) */
@font-face { font-family: "LeaseFinch Signature"; src: url("../fonts/GreatVibes-Regular.ttf") format("truetype"); font-display: swap; }
.lf-signature-typed { font-family: "LeaseFinch Signature", cursive; font-size: 2.4rem; line-height: 1.2; color: #1f2933; min-height: 3.2rem; }
.lf-signature-box { background: #fff; border: 1px dashed var(--mud-palette-lines-inputs); border-radius: 8px; padding: 8px 16px; }
.lf-signature-canvas { display: block; width: 100%; height: 180px; touch-action: none; background: #fff; border-radius: 8px;
    border: 1px dashed var(--mud-palette-lines-inputs); cursor: crosshair; }

/* Read-only view of a document's text (what the tenant reads and signs) */
.lf-doc { font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.lf-doc h1, .lf-doc h2, .lf-doc h3 { line-height: 1.3; margin: 1.2em 0 .4em; }
.lf-doc h2 { font-size: 1.25rem; }
.lf-doc h3 { font-size: 1.05rem; }
.lf-doc p { margin: 0 0 .6em; }
.lf-doc ol, .lf-doc ul { margin: 0 0 .6em; padding-left: 1.6em; }
.lf-doc li[data-list="bullet"] { list-style-type: disc; }
.lf-doc li[data-list="ordered"] { list-style-type: decimal; }
.lf-doc li > span:empty { display: none; }
.lf-doc blockquote { margin: 0 0 .6em; padding-left: 12px; border-left: 3px solid var(--mud-palette-lines-default); font-style: italic; }
.lf-doc a { color: var(--mud-palette-primary); }
.lf-doc .ql-align-center { text-align: center; }
.lf-doc .ql-align-right { text-align: right; }
.lf-doc .ql-align-justify { text-align: justify; }
.lf-doc .ql-indent-1 { margin-left: 2em; } .lf-doc .ql-indent-2 { margin-left: 4em; } .lf-doc .ql-indent-3 { margin-left: 6em; }
.lf-doc .ql-indent-4 { margin-left: 8em; } .lf-doc .ql-indent-5 { margin-left: 10em; } .lf-doc .ql-indent-6 { margin-left: 12em; }

/* Editor (Quill): follow the app's colors in light and dark mode */
.lf-editor .ql-toolbar.ql-snow { border-color: var(--mud-palette-lines-inputs); border-radius: 8px 8px 0 0; background: var(--mud-palette-background-gray); }
.lf-editor .ql-container.ql-snow { border-color: var(--mud-palette-lines-inputs); border-radius: 0 0 8px 8px; font-family: inherit; font-size: 1rem; }
.lf-editor .ql-editor { min-height: 420px; line-height: 1.6; color: var(--mud-palette-text-primary); }
.lf-editor .ql-editor.ql-blank::before { color: var(--mud-palette-text-disabled); }
.lf-editor .ql-snow .ql-stroke { stroke: var(--mud-palette-text-secondary); }
.lf-editor .ql-snow .ql-fill { fill: var(--mud-palette-text-secondary); }
.lf-editor .ql-snow .ql-picker { color: var(--mud-palette-text-secondary); }
.lf-editor .ql-snow .ql-picker-options { background: var(--mud-palette-surface); }
.lf-editor .ql-snow .ql-tooltip { z-index: 10; }
.lf-editor-readonly .ql-container.ql-snow { border-radius: 8px; }
