/*
 * The downloader's own pages (/external-user: dashboard, profile, downloads). They run on the admin's design system
 * (ui.css, switched on by .ua-page) and its chrome (chrome.css); this file adds only what those pages have that the
 * admin does not: the greeting card, the allowance ring, the download list, the brochure-card preview, the quick
 * links and the profile header. Colours and corners come from the kit's tokens, so dark mode follows.
 */

/* Pages fade in rather than snapping, the one bit of motion here (skipped for reduced motion). */
.ua-account > * { animation: acc-in .28s ease both; }
.ua-account > *:nth-child(2) { animation-delay: .03s; }
.ua-account > *:nth-child(3) { animation-delay: .06s; }
.ua-account > *:nth-child(4) { animation-delay: .09s; }
@keyframes acc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ua-account > * { animation: none; } }

/* ---------------------------------------------------------------- avatar */
.acc-avatar {
    width: 36px; height: 36px; min-width: 36px; border-radius: 50%; object-fit: cover;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ua-accent-wash, #eff4ff); color: var(--ua-accent-ink, #1d4ed8);
    font-size: .8125rem; font-weight: 700; letter-spacing: .02em;
    border: 2px solid var(--ua-card, #fff); box-shadow: 0 0 0 1px var(--ua-line, #eceff3);
}
.acc-avatar--lg { width: 64px; height: 64px; min-width: 64px; font-size: 1.25rem; }
.acc-header-name { font-size: .875rem; font-weight: 600; color: #1f2937; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- greeting */
.acc-hero {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    background:
        radial-gradient(120% 140% at 100% 0%, var(--ua-accent-wash, #eff4ff) 0%, transparent 55%),
        var(--ua-card, #fff);
}
.acc-hero__who { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.acc-hero__hello { margin: 0; font-size: .8125rem; color: var(--ua-muted); }
.acc-hero__name { margin: 0; font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: var(--ua-text); }
.acc-hero__meta { margin: .25rem 0 0; font-size: .8125rem; color: var(--ua-text-soft); display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.acc-hero__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------------------------------------------------------------- email notice */
.acc-notice {
    display: flex; flex-wrap: wrap; align-items: center; gap: .875rem;
    padding: .875rem 1.125rem; margin-bottom: 1.25rem;
    border: 1px solid #fde68a; border-radius: var(--ua-r-lg, 16px); background: #fffbeb; color: #78350f;
}
.acc-notice__icon { font-size: 1.25rem; color: #b45309; }
.acc-notice__text { flex: 1 1 320px; display: flex; flex-direction: column; gap: .125rem; font-size: .875rem; }
.acc-notice__text span { color: #92400e; font-size: .8125rem; }
/* Asking for more downloads, and the answer. */
.acc-notice--ok { border-color: #bbf7d0; background: #f0fdf4; color: #14532d; }
.acc-notice--ok .acc-notice__icon { color: #16a34a; }
.acc-ask__fields { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.acc-ask__fields .form-select { width: auto; min-width: 11rem; }
.acc-ask__fields .form-control { flex: 1 1 14rem; min-width: 0; }

/* ---------------------------------------------------------------- figures */
.acc-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.acc-kpi__date { font-size: 1.5rem; }
.acc-kpi--ring { display: flex; flex-direction: column; }
.acc-ring {
    --p: 0;
    width: 64px; height: 64px; border-radius: 50%; margin: .125rem 0 .5rem;
    background: conic-gradient(var(--ua-accent, #2563eb) calc(var(--p) * 1%), var(--ua-bar, #eaf0fb) 0);
    display: grid; place-items: center;
    transition: background .4s ease;
}
.acc-ring span {
    width: 48px; height: 48px; border-radius: 50%; background: var(--ua-card, #fff);
    display: grid; place-items: center;
    font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ua-text);
}

/* ---------------------------------------------------------------- two columns */
.acc-pair { align-items: start; }
.acc-pair > .ua-card, .acc-stack > .ua-card { margin-bottom: 0; }
.acc-stack { display: grid; gap: 1.25rem; }
@media (max-width: 991.98px) { .acc-pair { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- download rows */
.acc-row {
    display: flex; align-items: center; gap: .75rem; padding: .625rem .5rem; margin: 0 -.5rem;
    border-radius: 10px; transition: background .14s ease;
}
.acc-row + .acc-row { border-top: 1px solid var(--ua-line); }
.acc-row:hover { background: var(--ua-hover); }
.acc-row__icon {
    width: 36px; height: 36px; min-width: 36px; border-radius: 10px; display: grid; place-items: center;
    background: var(--ua-accent-wash); color: var(--ua-accent-ink); font-size: .875rem;
}
.acc-row__icon--property { background: var(--ua-up-wash); color: var(--ua-up); }
.acc-row__icon--developer { background: #fff7ed; color: #b45309; }
.acc-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.acc-row__name { font-size: .875rem; font-weight: 600; color: var(--ua-text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.acc-row__name:hover { color: var(--ua-accent-ink); text-decoration: underline; }
.acc-row__meta { font-size: .75rem; color: var(--ua-muted); display: flex; align-items: center; gap: .4rem; }
.acc-row__count { font-size: .8125rem; font-weight: 600; color: var(--ua-text-soft); font-variant-numeric: tabular-nums; }

.acc-empty { text-align: center; padding: 1.75rem .5rem; color: var(--ua-muted); }
.acc-empty > i { font-size: 1.75rem; color: var(--ua-line-strong); margin-bottom: .5rem; display: block; }
.acc-empty p { font-size: .875rem; margin: 0 auto 1rem; max-width: 360px; }

/* ---------------------------------------------------------------- brochure card preview */
.acc-card-preview { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--ua-line); }
.acc-card-preview__label { margin: 0 0 .5rem; font-size: .75rem; font-weight: 600; color: var(--ua-muted); text-transform: uppercase; letter-spacing: .06em; }
.acc-card-preview__body {
    display: flex; align-items: center; gap: .875rem; padding: .875rem 1rem;
    border-radius: 12px; background: #171617; color: #fff;
}
.acc-card-preview__body .acc-avatar { width: 48px; height: 48px; min-width: 48px; border-color: #171617; box-shadow: 0 0 0 1px rgba(255,255,255,.2); }
.acc-card-preview__body strong { display: block; font-size: .9375rem; }
.acc-card-preview__body .min-w-0 > span { display: block; font-size: .75rem; color: rgba(255,255,255,.75); }
.acc-card-preview__lines span { color: rgba(255,255,255,.75); font-size: .75rem; }
.acc-card-preview__lines { display: flex !important; flex-wrap: wrap; gap: .25rem .875rem; margin-top: .25rem; }
.acc-card-preview__lines i { margin-right: .25rem; opacity: .8; }

/* ---------------------------------------------------------------- quick links */
.acc-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.acc-tile {
    display: flex; align-items: center; gap: .625rem; padding: .75rem .875rem;
    border: 1px solid var(--ua-line); border-radius: 12px; background: var(--ua-card);
    color: var(--ua-text-soft); font-size: .8125rem; font-weight: 600; text-decoration: none;
    transition: border-color .14s ease, color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.acc-tile i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--ua-hover); color: var(--ua-accent-ink); }
.acc-tile:hover { border-color: var(--ua-accent-line); color: var(--ua-text); transform: translateY(-1px); box-shadow: var(--ua-shadow-lift); }

/* ---------------------------------------------------------------- profile */
.acc-profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.acc-photo-field { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.acc-photo-field .acc-avatar { width: 72px; height: 72px; min-width: 72px; font-size: 1.375rem; }
.acc-photo-field input[type=file] { max-width: 340px; }
.ua-account :target { scroll-margin-top: 130px; }
.ua-account .ua-field:has(:target), .ua-account .ua-field:target { animation: acc-flash 1.6s ease; border-radius: 10px; }
@keyframes acc-flash { 0%, 40% { box-shadow: 0 0 0 4px var(--ua-accent-wash); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------------------------------------------------------------- downloads table */
.acc-table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.acc-table-tools .form-control { height: 34px; max-width: 260px; font-size: .8125rem; }
.acc-table-tools .ua-seg { margin: 0; }
.acc-table td a { color: var(--ua-text); font-weight: 600; text-decoration: none; }
.acc-table td a:hover { color: var(--ua-accent-ink); text-decoration: underline; }
.acc-table .num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 575.98px) {
    .acc-hero__actions { width: 100%; }
    .acc-hero__actions .ua-btn { flex: 1 1 0; justify-content: center; }
    .acc-tiles { grid-template-columns: 1fr; }
}
.acc-kpi__of { font-size: 1rem; font-weight: 500; color: var(--ua-muted); }

/* Languages as tick pills. */
.acc-langs { display: flex; flex-wrap: wrap; gap: .5rem; }
.acc-lang { position: relative; margin: 0; cursor: pointer; }
.acc-lang input { position: absolute; opacity: 0; pointer-events: none; }
.acc-lang span {
    display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .875rem;
    border: 1px solid var(--ua-line-strong); border-radius: 999px; background: var(--ua-card);
    font-size: .8125rem; font-weight: 550; color: var(--ua-text-soft); transition: all .14s ease;
}
.acc-lang input:checked + span { background: var(--ua-accent-wash); border-color: var(--ua-accent); color: var(--ua-accent-ink); }
.acc-lang input:checked + span::before { content: "\2713"; font-weight: 700; }
.acc-lang input:focus-visible + span { box-shadow: 0 0 0 3px var(--ua-accent-wash); }
@media (min-width: 576px) { .acc-table-tools { flex-wrap: nowrap; } }
.acc-table .acc-col-date, .acc-table .acc-col-first { white-space: nowrap; }
@media (max-width: 575.98px) {
    /* A phone keeps the name, the kind, the count and the last date. */
    .acc-table .acc-col-first, .acc-table .acc-col-time { display: none; }
    .acc-table th, .acc-table td { padding-left: .375rem; padding-right: .375rem; }
    .acc-table-tools, .acc-table-tools .form-control { width: 100%; max-width: none; }
}

/* ================================================================ signed-out pages (layouts/guest) */
.acc-auth-body { margin: 0; font-family: Ubuntu, "Noto Sans Bengali UI", Arial, sans-serif; background: #f7f8fa; }
.acc-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }

.acc-auth__brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
    padding: 2.5rem 3rem; color: #e2e8f0;
    background:
        radial-gradient(90% 60% at 100% 0%, rgba(37, 99, 235, .35) 0%, transparent 60%),
        radial-gradient(70% 50% at 0% 100%, rgba(226, 185, 59, .18) 0%, transparent 60%),
        #0f172a;
}
.acc-auth__logo img { height: 34px; width: auto; filter: brightness(0) invert(1); }
.acc-auth__logo--small { display: none; }
.acc-auth__logo--small img { filter: none; height: 30px; }
.acc-auth__pitch h2 { font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: #fff; margin: 0 0 1.5rem; max-width: 440px; }
.acc-auth__pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; max-width: 440px; }
.acc-auth__pitch li { display: flex; gap: .75rem; align-items: flex-start; font-size: .9375rem; line-height: 1.5; color: #cbd5e1; }
.acc-auth__pitch li svg { flex: 0 0 auto; margin-top: 2px; color: #93c5fd; }
.acc-auth__stat { margin: 0; font-size: .875rem; color: #94a3b8; }
.acc-auth__stat strong { display: block; font-size: 2rem; font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1.1; }

.acc-auth__main {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2.5rem 1.5rem; background: var(--ua-bg, #f7f8fa);
}
.acc-auth__card {
    width: 100%; max-width: 460px; padding: 2rem;
    background: var(--ua-card, #fff); border: 1px solid var(--ua-line, #eceff3); border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    animation: acc-in .3s ease both;
}
.acc-auth__card:has(.acc-auth__grid) { max-width: 620px; }
.acc-auth__title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .25rem; color: var(--ua-text, #0f172a); }
.acc-auth__sub { margin: 0 0 1.5rem; font-size: .875rem; color: var(--ua-text-soft, #475569); line-height: 1.5; }

.acc-auth__alert { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: 12px; background: var(--ua-down-wash, #fff1f3); color: var(--ua-down, #be123c); font-size: .8125rem; border: 1px solid #fecdd3; }
.acc-auth__alert--ok { background: var(--ua-up-wash, #ecfdf5); color: var(--ua-up, #047857); border-color: #a7f3d0; }

.acc-auth__form { display: grid; gap: 1rem; }
.acc-auth__form > .ua-field { height: auto; }
.acc-auth__form .form-label { font-size: .8125rem; font-weight: 600; color: var(--ua-text-soft, #475569); margin-bottom: .375rem; text-transform: none; letter-spacing: 0; }
.acc-auth__form .ua-form-grid .form-label { font-size: .8125rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ua-text-soft, #475569); }
.acc-auth__form .form-control, .acc-auth__form .form-select { min-height: 44px; border-radius: 10px; font-size: .9375rem; }
.acc-auth__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.acc-auth__labelrow a, .acc-auth__switch a { color: var(--ua-accent-ink, #1d4ed8); font-size: .8125rem; font-weight: 600; text-decoration: none; }
.acc-auth__labelrow a:hover, .acc-auth__switch a:hover { text-decoration: underline; }
.acc-auth__submit { width: 100%; justify-content: center; height: 46px; font-size: .9375rem; border-radius: 10px; margin-top: .25rem; }
.acc-auth__switch { margin: .25rem 0 0; text-align: center; font-size: .875rem; color: var(--ua-text-soft, #475569); }
.acc-auth__note { margin: 0; text-align: center; font-size: .75rem; color: var(--ua-muted, #8b95a5); }
.acc-auth__foot { margin: 1.25rem 0 0; font-size: .75rem; color: var(--ua-muted, #8b95a5); }
.acc-auth__foot a { color: inherit; }

.acc-google {
    display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; height: 46px;
    border: 1px solid var(--ua-line-strong, #dfe4ea); border-radius: 10px; background: #fff;
    color: var(--ua-text, #0f172a); font-size: .9375rem; font-weight: 600; text-decoration: none;
    transition: background .14s ease, box-shadow .14s ease;
}
.acc-google:hover { background: var(--ua-hover, #f8fafc); box-shadow: var(--ua-shadow, 0 1px 3px rgba(15,23,42,.06)); color: var(--ua-text, #0f172a); }
.acc-or { position: relative; text-align: center; margin: 1.25rem 0; }
.acc-or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--ua-line, #eceff3); }
.acc-or span { position: relative; padding: 0 .75rem; background: var(--ua-card, #fff); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ua-muted, #8b95a5); }

@media (max-width: 991.98px) {
    .acc-auth { grid-template-columns: 1fr; }
    .acc-auth__brand { display: none; }
    .acc-auth__logo--small { display: inline-block; margin-bottom: 1.25rem; }
    .acc-auth__main { justify-content: flex-start; padding: 1.5rem 1rem; }
}
@media (max-width: 575.98px) {
    .acc-auth__card { padding: 1.5rem 1.25rem; border-radius: 16px; }
}
.ua-pw-wrap:has(> .is-invalid) ~ .invalid-feedback { display: block; }
