/* 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;
    }
}

.account-payments-scroll { overflow-x: auto; margin-top: 1.5rem; }
.account-payments-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .8rem; }
.account-payments-table th { color: #62576e; font-weight: 600; background: #f6f2fc; }
.account-payments-table th, .account-payments-table td { padding: .85rem .75rem; border-bottom: 1px solid #e4dcea; white-space: nowrap; }
.account-payments-scroll:focus-visible { outline: 2px solid var(--violet-dark); outline-offset: 3px; }

.account-tabs { display: flex; gap: .35rem; padding: .35rem; background: #eee8f8; border: 1px solid #ddd3ea; border-radius: 14px; }
.account-tab { display: flex; align-items: center; justify-content: center; gap: .65rem; flex: 1; padding: .9rem .75rem; min-height: 48px; border-radius: 10px; color: #64576f; font-size: .85rem; font-weight: 600; text-decoration: none; }
.account-tab:hover { color: var(--violet-dark); background: #ffffff70; }
.account-tab.is-active { background: white; color: var(--violet-dark); box-shadow: 0 2px 8px #3922580d; }
.account-tab-count { padding: .15rem .45rem; border-radius: 20px; font-size: .7rem; background: #e3daee; }
.account-tab.is-active .account-tab-count { background: #efe8ff; }
@media (max-width: 380px) { .account-tab { padding: .75rem .4rem; gap: .35rem; font-size: .75rem; } }

.account-billing-mode { display: inline-block; width: fit-content; margin-top: .55rem; padding: .3rem .65rem; border: 1px solid #d8c7f1; border-radius: 6px; background: #f0e8fc; color: #5f34a0; font-size: .75rem; font-weight: 600; line-height: 1.4; }

/* Service detail and payment history. */
.account-detail-page .account-grid > *, .account-detail-page .account-stack { min-width: 0; }
.account-detail-eyebrow { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: #705891; margin-bottom: .75rem; }
.account-detail-page .account-detail-hero h1 { overflow-wrap: anywhere; }
.account-detail-page .account-detail-hero .account-lead { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.account-detail-page .account-detail-hero .account-billing-mode { margin-top: 0; }
.account-detail-page .account-total { background: #faf7ff; border-color: #ddd0ef; }
.account-detail-page .account-total-amount { font-size: clamp(1.5rem, 2.4vw, 2rem); overflow-wrap: anywhere; }
.account-detail-page .account-contact { display: grid; gap: .75rem; }
.account-detail-page .account-contact a { border-radius: 12px; font-size: .8rem; }
.account-payment-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.account-payment-heading h2 { margin: 0; }
.account-payment-heading .account-detail-eyebrow { margin-bottom: .5rem; }
.account-payment-count { padding: .35rem .65rem; border: 1px solid #e0d6eb; border-radius: 8px; color: #766583; font-size: .7rem; }
.account-payment-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0 0; }
.account-payment-summary > div { padding: 1.25rem; border: 1px solid #e4dbed; background: #f8f4fc; border-radius: 14px; min-width: 0; }
.account-payment-summary > div:first-child { background: #f0f8f1; border-color: #d8e9dc; }
.account-payment-summary dt { font-size: .75rem; color: #675b71; line-height: 1.6; }
.account-payment-summary dd { margin: .5rem 0 0; font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 700; overflow-wrap: anywhere; }
.account-payment-summary > div:first-child dd { color: #286541; }
.account-payment-empty { padding: 2rem 1rem; margin-top: 1.5rem; text-align: center; border: 1px dashed #d8cbe5; border-radius: 14px; }
.account-payment-empty > span { display: block; font-size: 2rem; color: #8b67bc; margin-bottom: .75rem; }
.account-payment-empty strong { font-size: .85rem; }
.account-payment-empty p { font-size: .8rem; color: #74677e; line-height: 1.8; margin-bottom: 0; }
.account-payment-amount { font-weight: 600; }
.account-payment-badge { display: inline-block; padding: .3rem .55rem; border-radius: 6px; font-size: .7rem; font-weight: 600; }
.account-payment-badge.is-paid { background: #e9f5ed; color: #286541; }
.account-payment-badge.is-pending { background: #fff3dd; color: #875d1c; }
.account-payment-badge.is-overdue { background: #fbe9e8; color: #a13935; }
.account-payment-card > .account-note:last-child { border-top: 1px solid #e7dfee; padding-top: 1rem; margin-top: 1.5rem; line-height: 1.8; }
@media (max-width: 560px) {
    .account-payment-summary { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
    .account-payment-summary > div { padding: 1rem; }
    .account-payment-card .account-payments-table, .account-payment-card .account-payments-table tbody { display: block; }
    .account-payment-card .account-payments-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .account-payment-card .account-payments-table tr { display: block; padding: .75rem; margin-bottom: .75rem; border: 1px solid #e4dcea; border-radius: 12px; }
    .account-payment-card .account-payments-table td { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; border: 0; white-space: normal; text-align: right; font-size: .75rem; }
    .account-payment-card .account-payments-table td::before { content: attr(data-label); color: #74677e; text-align: left; flex-shrink: 0; font-weight: 400; }
}

.account-payment-overview { display: grid; gap: .75rem; margin: 1.5rem 0 0; padding: 1rem 0; border-top: 1px solid #e7dfee; border-bottom: 1px solid #e7dfee; }
.account-payment-overview > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; font-size: .85rem; line-height: 1.6; }
.account-payment-overview dt { color: #74677e; font-weight: 400; }
.account-payment-overview dd { margin: 0; font-weight: 500; color: #493b56; }

/* Keep currency amounts inside narrow cards and service rows. */
.account-quote-main, .account-quote-side { min-width: 0; }
.account-quote-side strong { white-space: normal; overflow-wrap: anywhere; font-size: clamp(.8rem, 1.6vw, 1rem); }
.account-detail-page .account-total { min-width: 0; }
.account-detail-page .account-total-amount { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; font-size: clamp(1.15rem, 2vw, 1.6rem); }
.account-payment-overview dd { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
