/* Customer account ("Mi cuenta"), styled with the public site's tokens from app.css. */

.account-page {
    background: #f7f5fc;
    padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.account-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero band */

.account-hero {
    padding: clamp(1.25rem, 3vw, 1.75rem) 0;
    background: radial-gradient(ellipse at top left, rgba(120, 77, 254, 0.14), transparent 60%), var(--bg);
    border-bottom: 1px solid var(--line);
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.account-hero-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 2rem;
}

.account-hero h1 {
    font-size: clamp(1.3rem, 2.6vw, 1.6rem);
    line-height: 1.2;
    margin: 0 0 .3rem;
    overflow-wrap: anywhere;
}

.account-hero .eyebrow {
    margin-bottom: .6rem;
    font-size: .68rem;
    padding: .3rem .75rem;
}

.account-hero .account-lead {
    font-size: .92rem;
}

.account-login h1 {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    line-height: 1.15;
    margin: 0 0 .6rem;
    overflow-wrap: anywhere;
}

.account-lead {
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

.account-hero .account-lead + .btn-primary {
    margin-top: 1.25rem;
}

.account-back {
    display: block;
    width: fit-content;
    margin-bottom: .6rem;
    color: var(--violet-dark);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.account-back:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Quote detail heading */

.account-detail-hero {
    padding: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.account-detail-hero .account-back {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
    font-size: .82rem;
}

.account-detail-hero h1 {
    max-width: 32ch;
    margin: 0 0 1rem;
    font-size: clamp(1.65rem, 4vw, 2.4rem);
    line-height: 1.2;
}

.account-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem 1rem;
}

.account-detail-meta .account-lead {
    font-size: .82rem;
}

/* Layout */

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

.account-stack {
    display: grid;
    gap: 1.5rem;
}

.account-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 16px 40px rgba(50, 36, 90, 0.05);
}

.account-card h2 {
    font-size: 1.05rem;
    margin: 0 0 1rem;
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: -.25rem 0 .5rem;
}

.account-card-header h2 {
    margin: 0;
}

.account-count {
    min-width: 28px;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--violet-tint);
    color: var(--violet-dark);
    font-size: .8rem;
    font-weight: 700;
    text-align: center;
}

.account-page .btn-primary,
.account-page .btn-ghost {
    gap: .5rem;
}

.account-block {
    display: flex;
    width: 100%;
}

.account-note {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.6;
    margin: .75rem 0 0;
}

/* Quote list */

.account-quotes {
    list-style: none;
    margin: 0 -1.5rem -1.5rem;
    padding: 0;
}

.account-quote {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    border-top: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    transition: background .15s ease;
}

.account-quotes li:last-child .account-quote {
    border-radius: 0 0 18px 18px;
}

.account-quote:hover {
    background: #faf8ff;
}

.account-quote-main strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-quote-main small {
    display: block;
    margin-top: .25rem;
    color: var(--muted);
    font-size: .82rem;
}

.account-quote-side {
    display: grid;
    justify-items: end;
    gap: .35rem;
    text-align: right;
}

.account-quote-side strong {
    font-size: .95rem;
    white-space: nowrap;
}

.account-quote-arrow {
    color: var(--violet);
    font-weight: 700;
    transition: transform .15s ease;
}

.account-quote:hover .account-quote-arrow {
    transform: translateX(3px);
}

/* Status badges */

.account-badge {
    display: inline-block;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.account-badge-lg {
    font-size: .9rem;
    padding: .45rem 1rem;
}

.account-badge-review { background: #fff4dc; color: #8a5c0f; }
.account-badge-sent { background: var(--violet-tint); color: var(--violet-dark); }
.account-badge-talking { background: #e6f1ff; color: #2b5d99; }
.account-badge-approved { background: var(--success-bg); color: var(--success); }
.account-badge-closed { background: #f1f0f4; color: #5c5866; }

/* Empty state */

.account-empty {
    text-align: center;
    padding: 1.5rem .5rem .5rem;
}

.account-empty h3 {
    font-size: 1.1rem;
    margin: 0 0 .6rem;
}

.account-empty > p:not(.account-note) {
    max-width: 420px;
    margin: 0 auto 1.5rem;
    color: var(--muted);
    line-height: 1.6;
}

.account-empty-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 18px;
    background: var(--violet-tint);
    color: var(--violet-dark);
}

/* Profile */

.account-profile {
    text-align: center;
}

.account-avatar {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--violet-tint);
    color: var(--violet-dark);
    font-weight: 700;
    font-size: .85rem;
}

.account-avatar-lg {
    width: 88px;
    height: 88px;
    margin-bottom: 1rem;
    font-family: "Lexend Exa", sans-serif;
    font-size: 2rem;
}

/* Google photo covers the initial; app.js removes it if it fails to load. */
.account-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: inherit;
}

.account-profile-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
}

.account-profile-email {
    color: var(--muted);
    font-size: .88rem;
    margin: .25rem 0 1.25rem;
    overflow-wrap: anywhere;
}

.account-facts {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 1rem 0 0;
    border-top: 1px solid var(--line);
    display: grid;
    gap: .5rem;
    font-size: .88rem;
    color: var(--muted);
}

.account-profile .btn-ghost {
    margin-bottom: .75rem;
}

.account-logout {
    width: 100%;
    min-height: 44px;
    padding: .7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    color: var(--danger);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.account-logout:hover {
    background: var(--danger-bg);
    border-color: rgba(204, 72, 69, 0.35);
}

/* Quote detail */

.account-status-note {
    margin: 0;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    border-left: 4px solid var(--violet);
    background: var(--paper);
    line-height: 1.6;
}

.account-facts-table {
    margin: 0;
    display: grid;
}

.account-facts-table div {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
    padding: .65rem 0;
    border-top: 1px solid var(--line);
}

.account-facts-table div:first-child {
    border-top: 0;
    padding-top: 0;
}

.account-facts-table dt {
    color: var(--muted);
}

.account-facts-table dd {
    margin: 0;
    font-weight: 500;
}

.account-message {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.7;
}

.account-total {
    border-top: 4px solid var(--violet);
    position: sticky;
    top: 100px;
}

.account-total-label {
    font-family: "Montserrat", sans-serif;
    font-size: .75rem !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .5rem !important;
}

.account-total-amount {
    font-family: "Lexend Exa", sans-serif;
    font-size: clamp(1.3rem, 2.2vw, 1.55rem);
    font-weight: 700;
    white-space: nowrap;
    margin: 0;
}

.account-total-pending {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.account-total-includes {
    font-weight: 700;
    font-size: .88rem;
    margin: 1.25rem 0 .4rem;
}

.account-services {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .9rem;
    line-height: 1.7;
}

.account-contact {
    display: grid;
    gap: .6rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.account-decision { display: grid; gap: .65rem; margin: 1.5rem 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.account-decision button { font: inherit; cursor: pointer; justify-content: center; }
.account-decision-receipt { display: flex; align-items: flex-start; gap: .75rem; margin-top: 1.5rem; padding: 1rem; border: 1px solid #d6e8dc; border-radius: 14px; background: var(--success-bg); color: #245d39; }
.account-decision-receipt.is-rejected { background: #f4f2f7; border-color: #e1dce8; color: #5b5266; }
.account-decision-icon { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border: 1px solid currentColor; border-radius: 50%; font-size: .9rem; }
.account-decision-receipt strong { display: block; font-size: .85rem; line-height: 1.5; }
.account-decision-receipt div > span { display: block; margin-top: .3rem; font-size: .75rem; line-height: 1.5; }

/* Sign in */

.account-login-page {
    padding-bottom: 0;
    background: radial-gradient(ellipse at 20% 20%, #e6dcff, transparent 60%),
                radial-gradient(ellipse at 85% 85%, #fff0d8, transparent 50%), #f7f4fc;
}

.account-login {
    display: grid;
    place-items: center;
    min-height: 65vh;
    padding: clamp(2.5rem, 7vw, 5rem) 1.25rem;
}

.account-login-card {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 490px;
    padding: clamp(1.5rem, 5vw, 3rem);
    background: var(--paper);
    border: 1px solid #e6dff2;
    border-radius: 24px;
    box-shadow: 0 20px 65px #4c2d8610;
    text-align: left;
}

.account-login-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 9px -7px -9px 7px;
    border: 1px solid #d7c9f1;
    border-radius: 24px;
    pointer-events: none;
}

.account-login-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.account-login-mark { display: grid; place-items: center; width: 52px; height: 52px; flex-shrink: 0; color: #5630ba; background: #fff0d4; border-radius: 16px; transform: rotate(7deg); }

.account-login-kicker {
    display: block;
    margin: 0;
    color: var(--violet-dark);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
}

.account-login-card h1 {
    font-size: clamp(1.45rem, 4.5vw, 2rem);
    line-height: 1.35;
    margin: 0 0 .85rem;
}

.account-login-card h1 span { color: var(--violet-dark); }
.account-login-card .account-lead { font-size: .88rem; margin-bottom: 2rem; }
.account-login-first { font-size: .75rem; line-height: 1.7; margin: 1.25rem 0 .5rem; text-align: center; }
.account-login-first strong { display: block; font-weight: 500; }
.account-login-card .account-note { font-size: .7rem; line-height: 1.7; margin: 0; text-align: center; }
.account-login-bottom { display: grid; gap: .5rem; margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .78rem; }
.account-login-bottom > span { color: var(--muted); }
.account-login-bottom a { color: var(--violet-dark); font-weight: 600; text-underline-offset: 4px; }
.account-login-bottom a span { margin-left: .3rem; }
.account-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    width: 100%;
    min-height: 52px;
    padding: .85rem 1.5rem;
    border: 1px solid #c8c3d2;
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
}

.account-google:hover {
    background: #f6f3ff;
}

.account-google:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.account-alert {
    padding: .85rem 1rem;
    border-radius: 12px;
    background: #fff4dc;
    font-size: .9rem;
    line-height: 1.6;
    text-align: left;
    margin: 0 0 1.25rem;
}

.account-alert-error {
    background: var(--danger-bg);
    color: #8f2f2d;
}

/* Account link in the site navigation */

.site-nav-account .account-avatar {
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .account-grid {
        grid-template-columns: 1fr;
    }

    .account-total {
        position: static;
    }
}

@media (max-width: 560px) {
    .account-quote {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .account-quote-arrow {
        display: none;
    }

    .account-facts-table div {
        grid-template-columns: 1fr;
        gap: .15rem;
    }

    .account-hero-inner .btn-primary {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .account-quote,
    .account-quote-arrow,
    .account-google {
        transition: none;
    }
}
