/**
 * Apolar plugin styles (Mi cuenta, storage meter, login password button)
 *
 * Colors, fonts and radii come only from the tokens defined by the skins
 * (styles/theme.css of skins/apolar and skins/apolar_anil, see
 * docs/arquitectura.md). This file never defines tokens.
 */

/* --------------------------------------------------------------------- */
/* Rail button "Mi cuenta" (container "taskbar")                          */
/* --------------------------------------------------------------------- */

#taskmenu a.micuenta:before,
.menu a.micuenta:before {
    content: "\f2bd"; /* user-circle in Elastic's icon font */
}

/* --------------------------------------------------------------------- */
/* Shared pieces                                                          */
/* --------------------------------------------------------------------- */

.ap-ico {
    display: block;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --------------------------------------------------------------------- */
/* Mi cuenta: layout                                                      */
/* --------------------------------------------------------------------- */

.task-micuenta #layout-sidebar {
    background: var(--side-bg);
    color: var(--side-text);
    border-right: 0;
}

.task-micuenta #layout-sidebar > .scroller {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.task-micuenta #layout-content {
    background: var(--canvas);
    color: var(--text);
}

@media screen and (min-width: 769px) {
    .task-micuenta #layout-sidebar {
        flex: 0 0 248px !important;
        width: 248px !important;
        min-width: 248px;
        max-width: 248px;
    }

    /* the pane and the page carry their own titles on desktop */
    .task-micuenta #layout-sidebar > .header,
    .task-micuenta #layout-content > .header {
        display: none;
    }
}

/* --------------------------------------------------------------------- */
/* Mi cuenta: sections pane (same anatomy as the folder item)             */
/* --------------------------------------------------------------------- */

.ap-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 0 16px; /* the skin's pane scroller already pads 12px on the sides */
    font-family: var(--font-ui);
    letter-spacing: var(--ui-track);
}

.ap-sections a {
    text-decoration: none;
}

.ap-sections a:before {
    content: none !important;
    display: none !important;
}

.ap-back,
.ap-sec-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-row);
    color: var(--side-text);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

.ap-back {
    font-size: 13px;
    color: var(--side-text-2);
}

.ap-back:hover,
.ap-back:focus,
.ap-sec-link:hover,
.ap-sec-link:focus {
    background: var(--side-hover);
    color: var(--side-text);
    text-decoration: none;
}

.ap-back .ap-sec-icon,
.ap-sec-link .ap-sec-icon {
    color: var(--side-icon);
}

.ap-sec-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-sec-ext {
    color: var(--side-text-2);
}

.ap-who {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
    min-width: 0;
}

.ap-who-title {
    font-size: 15px;
    line-height: 20px;
    font-weight: 700;
    color: var(--side-text);
}

.ap-who-mail {
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    color: var(--side-text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-sec-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ap-sec {
    margin: 0;
    padding: 0;
}

/* selected "ficha" */
.ap-sec.selected .ap-sec-link {
    background: var(--ficha-bg);
    color: var(--ficha-text);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(17, 20, 23, .06), 0 1px 1px rgba(17, 20, 23, .04), inset 0 0 0 1.5px var(--ficha-ring);
}

.ap-sec.selected .ap-sec-link .ap-sec-icon {
    color: var(--ficha-icon);
}

.ap-sections a:focus-visible,
.ap-side-footer a:focus-visible,
#quotadisplay a:focus-visible {
    outline: 2px solid var(--side-text);
    outline-offset: 2px;
}

/* footer with the compact meter */
.ap-side-footer {
    flex: none;
    border-top: 1px solid var(--side-line);
    padding: 16px 22px 20px;
}

@media screen and (max-width: 768px) {
    .ap-who-title {
        display: none; /* the pane header already says "Mi cuenta" */
    }

    .ap-back,
    .ap-sec-link {
        min-height: 48px;
        font-size: 15px;
    }
}

/* --------------------------------------------------------------------- */
/* Mi cuenta: content                                                     */
/* --------------------------------------------------------------------- */

.ap-account-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ap-account {
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: content-box; /* the 800px column excludes the side padding */
    max-width: 800px;
    padding: 32px clamp(16px, 3vw, 40px) 48px;
    font-family: var(--font-ui);
    letter-spacing: var(--ui-track);
    color: var(--text);
}

.ap-page-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.ap-h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 32px;
    font-weight: 700;
    letter-spacing: var(--display-track);
    color: var(--text);
}

.ap-page-sub {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-3);
    overflow-wrap: anywhere;
}

.ap-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px rgba(17, 20, 23, .06), 0 1px 1px rgba(17, 20, 23, .04);
}

html.dark-mode .ap-card {
    box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, .35);
}

.ap-h2 {
    margin: 0;
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
    color: var(--text);
}

.ap-h2-sm {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 22px;
}

.ap-card-label {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: var(--text-3);
}

.ap-account a {
    color: var(--accent-text);
}

.ap-account a:focus-visible {
    outline: 2px solid var(--accent-ui);
    outline-offset: 2px;
}

.ap-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-text);
}

.ap-account a.ap-link:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

.ap-link-sm {
    font-size: 13px;
    line-height: 18px;
}

/* buttons */
.ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--btn-radius);
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.ap-account a.ap-btn-primary,
.ap-btn-primary {
    background: var(--accent-fill);
    color: var(--on-accent);
    box-shadow: inset 0 0 0 1px var(--accent-ring);
}

.ap-account a.ap-btn-primary:hover,
.ap-btn-primary:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
    text-decoration: none;
}

/* plan card */
.ap-plan-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ap-plan-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ap-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
}

.ap-pill-ok {
    background: var(--success-soft);
    color: var(--success-text);
}

.ap-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.ap-plan-summary {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 22px;
    color: var(--text-2);
}

.ap-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.ap-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 0 24px;
}

.ap-stat + .ap-stat {
    border-left: 1px solid var(--line);
}

.ap-stat:first-child {
    padding-left: 0;
}

.ap-stat:last-child {
    padding-right: 0;
}

.ap-stat-label {
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    color: var(--text-3);
}

.ap-stat-value {
    font-size: 15px;
    line-height: 22px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

@media screen and (max-width: 640px) {
    .ap-stats {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: minmax(0, 1fr);
        row-gap: 12px;
    }

    .ap-stat,
    .ap-stat:first-child,
    .ap-stat:last-child {
        padding: 0;
    }

    .ap-stat + .ap-stat {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 12px;
    }
}

/* storage card */
.ap-storage {
    gap: 12px;
}

.ap-storage-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-variant-numeric: tabular-nums;
}

.ap-storage-big {
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 32px;
    font-weight: 700;
    letter-spacing: var(--display-track);
    color: var(--text);
}

.ap-storage-of {
    font-size: 15px;
    line-height: 22px;
    font-weight: 500;
    color: var(--text-2);
}

.ap-storage-pct {
    font-size: 15px;
    line-height: 22px;
    font-weight: 700;
    color: var(--text);
}

.ap-storage.is-warn .ap-storage-pct {
    color: var(--warn-text);
}

.ap-storage.is-alert .ap-storage-pct {
    color: var(--danger-text);
}

.ap-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--bar-track);
    overflow: hidden;
}

.ap-bar-fill {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: 999px;
    background: var(--bar-ok);
    transition: width 200ms ease;
}

.ap-storage.is-warn .ap-bar-fill {
    background: var(--bar-warn);
}

.ap-storage.is-alert .ap-bar-fill {
    background: var(--bar-danger);
}

.ap-storage-caption {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* banner (80% or more) */
.ap-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 18px;
}

.ap-banner-warn {
    background: var(--warn-soft);
    color: var(--warn-text);
    box-shadow: inset 0 0 0 1px var(--warn-border);
}

.ap-banner-alert {
    background: var(--danger-soft);
    color: var(--danger-text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent);
}

.ap-banner-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ap-banner-text,
.ap-banner-actions {
    margin: 0;
}

.ap-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-weight: 600;
}

.ap-account .ap-banner a,
.ap-account .ap-banner a:hover {
    color: inherit;
    text-decoration: underline;
}

/* help rows */
.ap-help {
    gap: 4px;
    padding: 20px 16px 16px 24px;
}

.ap-account a.ap-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 8px 8px 0;
    border-radius: var(--radius-row);
    color: var(--text);
    text-decoration: none;
}

.ap-account a.ap-row:hover {
    background: var(--hover);
    color: var(--text);
}

.ap-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--chip);
    color: var(--text-2);
}

.ap-row-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.ap-row-title {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.ap-row-desc {
    font-size: 12px;
    line-height: 16px;
    color: var(--text-3);
}

.ap-row-chev {
    color: var(--text-3);
}

.ap-row-empty {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-3);
}

/* --------------------------------------------------------------------- */
/* Compact storage meter: #quotadisplay (mail) and Mi cuenta pane footer  */
/* --------------------------------------------------------------------- */

#layout #layout-sidebar > .footer.ap-quota-footer {
    display: block;
    height: auto;
    min-height: 0;
    line-height: normal;
    white-space: normal;
    overflow: visible;
    padding: 12px 12px 16px;
    font-weight: normal;
    background: transparent;
    border-top: 1px solid var(--side-line);
}

/* "#layout" outranks the skin's own #quotadisplay grid (html:root #quotadisplay),
   which is only meant for the plain Elastic widget */
#layout #quotadisplay.ap-quota-on {
    display: block;
    width: auto;
    max-width: none;
    padding: 0 10px;
    cursor: default;
}

#layout #quotadisplay.ap-quota-on.hidden {
    display: none;
}

/* Elastic's icon, percentage, bar and hidden label: the meter below replaces them
   (its progressbar has its own label) */
#layout #quotadisplay.ap-quota-on:before,
#layout #quotadisplay.ap-quota-on > .count,
#layout #quotadisplay.ap-quota-on > .bar,
#layout #quotadisplay.ap-quota-on > .voice {
    display: none !important;
}

.ap-quota {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-ui);
    letter-spacing: var(--ui-track);
    color: var(--side-text);
    text-align: left;
}

.ap-quota-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ap-quota-label {
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    color: var(--side-text-2);
}

a.ap-quota-more,
a.ap-quota-more:hover {
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    color: var(--side-text);
    text-decoration: underline;
}

.ap-quota-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--side-track);
    overflow: hidden;
}

.ap-quota-fill {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: 999px;
    background: var(--q-ok);
    transition: width 200ms ease;
}

.ap-quota.is-warn .ap-quota-fill {
    background: var(--q-warn);
}

.ap-quota.is-alert .ap-quota-fill {
    background: var(--q-alert);
}

.ap-quota-text {
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: var(--side-text);
    font-variant-numeric: tabular-nums;
}

.ap-quota.is-warn .ap-quota-state {
    color: var(--q-warn);
}

.ap-quota.is-alert .ap-quota-state {
    color: var(--q-alert);
}

/* 44px hit area for "Ampliar" on touch screens */
@media (pointer: coarse) {
    a.ap-quota-more {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        margin: -14px 0;
        padding: 0 4px;
    }
}

/* --------------------------------------------------------------------- */
/* Login: show/hide password                                              */
/* --------------------------------------------------------------------- */

.ap-eye-wrap {
    position: relative;
}

#rcmloginpwd.ap-has-eye {
    padding-right: 52px !important;
}

.ap-eye {
    position: absolute;
    top: 50%;
    right: 2px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -22px 0 0; /* centered without a transform, so a skin that sets top/margin wins cleanly */
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
}

.ap-eye:hover {
    background: var(--hover);
    color: var(--text);
}

.ap-eye:focus {
    outline: none;
}

.ap-eye:focus-visible {
    outline: 2px solid var(--accent-ui);
    outline-offset: -2px;
}

.ap-eye[aria-pressed="true"] {
    color: var(--accent-text);
}

/* --------------------------------------------------------------------- */
/* Motion and forced colors                                               */
/* --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .ap-bar-fill,
    .ap-quota-fill {
        transition: none;
    }
}

@media (forced-colors: active) {
    .ap-bar,
    .ap-quota-bar {
        border: 1px solid CanvasText;
    }

    .ap-bar-fill,
    .ap-quota-fill {
        background: Highlight;
    }

    .ap-sec.selected .ap-sec-link {
        outline: 2px solid Highlight;
    }

    .ap-eye:focus-visible,
    .ap-sections a:focus-visible,
    .ap-account a:focus-visible {
        outline: 2px solid CanvasText;
    }
}
