/* Settings → «Персонализация». Base styles for BOTH interface designs («Малахит» look; light + dark).
 * «Эфир» refinements live in css/redesign-web/account.css (scoped to body.yf-redesign.light-theme).
 * See docs/WEB_INTERFACE_DESIGNS.md. */

.yf-personalization:not([hidden]) {
    display: grid;
    gap: 14px;
}
.yf-personalization .yf-account-section { min-height: 0; }

/* Design options: two selectable cards with a miniature of each design */
.yf-design-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.yf-design-option {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 10px 10px 14px;
    border: 1px solid #dce5e2;
    border-radius: 14px;
    background: #fbfcfc;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease;
}
.yf-design-option:hover { border-color: #a9d8c7; }
.yf-design-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.yf-design-option:has(> input:checked) {
    border-color: #1f8a6a;
    background: #f1faf6;
    box-shadow: 0 0 0 3px rgba(31, 138, 106, .12);
}
.yf-design-option:has(> input:focus-visible) { box-shadow: 0 0 0 3px rgba(31, 138, 106, .35); }
.yf-design-option:has(> input:disabled) { cursor: progress; opacity: .7; }

.yf-design-option__meta { display: grid; gap: 3px; padding: 0 4px; }
.yf-design-option__meta strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1d2d29;
    font-size: 14px;
    font-weight: 700;
}
.yf-design-option__meta em {
    padding: 2px 7px;
    border-radius: 999px;
    background: #e6f5ef;
    color: #14765d;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}
.yf-design-option__meta small { color: #778681; font-size: 11.5px; line-height: 1.45; }

.yf-design-option__check {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: #1f8a6a;
    color: #fff;
    font-size: 13px;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .18s ease, transform .22s cubic-bezier(.34, 1.4, .64, 1);
}
.yf-design-option:has(> input:checked) .yf-design-option__check { opacity: 1; transform: none; }

/* Miniatures: pure CSS, no images — they stay crisp and cost nothing */
.yf-design-preview {
    display: grid;
    grid-template-rows: 14px auto 1fr;
    gap: 7px;
    aspect-ratio: 2 / 1;
    padding: 0 0 9px;
    overflow: hidden;
    border-radius: 10px;
}
.yf-design-preview i { display: block; }
.yf-design-preview__bar { display: flex; align-items: center; justify-content: space-between; padding: 0 9px; }
.yf-design-preview__bar i:first-child { width: 30px; height: 5px; border-radius: 3px; }
.yf-design-preview__bar i:last-child { width: 14px; height: 5px; border-radius: 3px; }
.yf-design-preview__tabs { display: flex; gap: 3px; width: max-content; margin: 0 9px; padding: 2px; }
.yf-design-preview__tabs i { width: 16px; height: 6px; border-radius: 2px; }
.yf-design-preview__cards { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; gap: 5px; margin: 0 9px; }
.yf-design-preview__cards i:first-child { grid-row: span 2; }

.yf-design-preview--classic { background: #eef3f1; }
.yf-design-preview--classic .yf-design-preview__bar { background: #0b2621; }
.yf-design-preview--classic .yf-design-preview__bar i { background: rgba(255, 255, 255, .55); }
.yf-design-preview--classic .yf-design-preview__tabs { width: auto; border: 1px solid rgba(27, 74, 65, .14); border-radius: 3px; background: #fff; }
.yf-design-preview--classic .yf-design-preview__tabs i { flex: 1 1 0; }
.yf-design-preview--classic .yf-design-preview__tabs i { background: #dfe8e4; }
.yf-design-preview--classic .yf-design-preview__tabs i:first-child { background: #174c40; }
.yf-design-preview--classic .yf-design-preview__cards i { border: 1px solid rgba(16, 32, 29, .11); border-radius: 3px; background: #fff; }

.yf-design-preview--modern { background: radial-gradient(120% 80% at 10% 0%, rgba(12, 122, 91, .10), transparent 60%), #f3f4f6; }
.yf-design-preview--modern .yf-design-preview__bar { background: rgba(255, 255, 255, .85); box-shadow: 0 1px 0 rgba(60, 60, 67, .08); }
.yf-design-preview--modern .yf-design-preview__bar i { background: #c9ccd2; }
.yf-design-preview--modern .yf-design-preview__bar i:first-child { background: #0c7a5b; }
.yf-design-preview--modern .yf-design-preview__tabs { border-radius: 5px; background: rgba(118, 118, 128, .14); }
.yf-design-preview--modern .yf-design-preview__tabs i { background: transparent; }
.yf-design-preview--modern .yf-design-preview__tabs i:first-child { background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.yf-design-preview--modern .yf-design-preview__cards i { border-radius: 6px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }

/* Dark mode: each preview shows how that design looks in the dark */
.dark-theme .yf-design-preview--classic { background: #12171a; }
.dark-theme .yf-design-preview--classic .yf-design-preview__bar { background: #0b1d19; }
.dark-theme .yf-design-preview--classic .yf-design-preview__tabs { border-color: rgba(211, 225, 230, .12); background: #1c2327; }
.dark-theme .yf-design-preview--classic .yf-design-preview__tabs i { background: #2a3438; }
.dark-theme .yf-design-preview--classic .yf-design-preview__tabs i:first-child { background: #2f8f76; }
.dark-theme .yf-design-preview--classic .yf-design-preview__cards i { border-color: rgba(211, 225, 230, .09); background: #1c2327; }
.dark-theme .yf-design-preview--modern { background: radial-gradient(120% 80% at 10% 0%, rgba(52, 211, 153, .12), transparent 60%), #0c0d0f; }
.dark-theme .yf-design-preview--modern .yf-design-preview__bar { background: rgba(23, 24, 27, .9); box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.dark-theme .yf-design-preview--modern .yf-design-preview__bar i { background: #3a3a40; }
.dark-theme .yf-design-preview--modern .yf-design-preview__bar i:first-child { background: #34d399; }
.dark-theme .yf-design-preview--modern .yf-design-preview__tabs { background: rgba(120, 120, 128, .24); }
.dark-theme .yf-design-preview--modern .yf-design-preview__tabs i:first-child { background: #3a3b40; box-shadow: none; }
.dark-theme .yf-design-preview--modern .yf-design-preview__cards i { background: #17181b; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }

.yf-personalization__status { min-height: 18px; margin: 16px 2px 0; color: #5e706a; font-size: 11.5px; }
.yf-personalization__status:empty { display: none; }
.yf-personalization__status.is-error { padding: 9px 12px; border-radius: 10px; background: rgba(200, 65, 77, .08); color: #c8414d; line-height: 1.45; }


/* Dark mode switch: a real switch in both designs. !important beats legacy ".dark-theme input { background … !important }". */
.yf-account-switch--theme { margin-top: 0; }
.yf-account-switch.yf-account-switch--inline { min-height: 32px; padding: 0; border: 0; background: transparent; box-shadow: none; align-items: center; }
body.yf-dashboard-auth.dark-theme .yf-account-switch.yf-account-switch--inline { border: 0; background: transparent; }
:is(.yf-account-switch--theme, .yf-account-switch--toggle) input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: #cfd8d5 !important;
    border: 0 !important;
    cursor: pointer;
    transition: background-color .2s ease;
}
:is(.yf-account-switch--theme, .yf-account-switch--toggle) input[type="checkbox"]::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    content: "";
    transition: transform .22s cubic-bezier(.34, 1.3, .64, 1);
}
:is(.yf-account-switch--theme, .yf-account-switch--toggle) input[type="checkbox"]:checked { background: #1f8a6a !important; }
:is(.yf-account-switch--theme, .yf-account-switch--toggle) input[type="checkbox"]:checked::after { transform: translateX(18px); }
:is(.yf-account-switch--theme, .yf-account-switch--toggle) input[type="checkbox"]:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(31, 138, 106, .3); }

@media (max-width: 575.98px) {
    .yf-design-options { grid-template-columns: minmax(0, 1fr); }
}

/* «Малахит» dark mode */
body.yf-dashboard-auth.dark-theme .yf-design-option { border-color: rgba(158, 201, 187, .14); background: #16302a; }
body.yf-dashboard-auth.dark-theme .yf-design-option:hover { border-color: rgba(158, 201, 187, .3); }
body.yf-dashboard-auth.dark-theme .yf-design-option:has(> input:checked) { border-color: #53bd97; background: #1a3a32; box-shadow: 0 0 0 3px rgba(83, 189, 151, .16); }
body.yf-dashboard-auth.dark-theme .yf-design-option__meta strong { color: #eef4f1; }
body.yf-dashboard-auth.dark-theme .yf-design-option__meta small { color: #a2b3ad; }
body.yf-dashboard-auth.dark-theme .yf-design-option__meta em { background: rgba(83, 189, 151, .16); color: #7fd8b5; }
body.yf-dashboard-auth.dark-theme .yf-design-option__check { background: #53bd97; color: #0f231e; }
body.yf-dashboard-auth.dark-theme .yf-personalization__status { color: #a2b3ad; }
body.yf-dashboard-auth.dark-theme :is(.yf-account-switch--theme, .yf-account-switch--toggle) input[type="checkbox"] { background: #3a4e48 !important; }
body.yf-dashboard-auth.dark-theme :is(.yf-account-switch--theme, .yf-account-switch--toggle) input[type="checkbox"]:checked { background: #53bd97 !important; }

/* Language: three compact options, current one checked */
.yf-language-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.yf-language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #dce5e2;
    border-radius: 12px;
    background: #fbfcfc;
    color: #1d2d29;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease;
}
.yf-language-option:hover { border-color: #a9d8c7; color: #1d2d29; }
.yf-language-option img { flex: 0 0 20px; border-radius: 50%; object-fit: cover; }
.yf-language-option span { flex: 1 1 auto; }
.yf-language-option i { color: #1f8a6a; font-size: 16px; opacity: 0; }
.yf-language-option[aria-current="page"] { border-color: #1f8a6a; background: #f1faf6; box-shadow: 0 0 0 3px rgba(31, 138, 106, .12); }
.yf-language-option[aria-current="page"] i { opacity: 1; }
@media (max-width: 575.98px) { .yf-language-options { grid-template-columns: minmax(0, 1fr); } }

body.yf-dashboard-auth.dark-theme .yf-language-option { border-color: rgba(158, 201, 187, .14); background: #16302a; color: #eef4f1; }
body.yf-dashboard-auth.dark-theme .yf-language-option:hover { border-color: rgba(158, 201, 187, .3); color: #eef4f1; }
body.yf-dashboard-auth.dark-theme .yf-language-option[aria-current="page"] { border-color: #53bd97; background: #1a3a32; box-shadow: 0 0 0 3px rgba(83, 189, 151, .16); }
body.yf-dashboard-auth.dark-theme .yf-language-option i { color: #7fd8b5; }

/* Theme-specific artwork rendered in both variants (live light/dark switch without a reload) */
body.light-theme .yf-theme-dark-only,
body.dark-theme .yf-theme-light-only { display: none !important; }
/* Live appearance switch: a soft cross-fade of the whole page (View Transitions) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .38s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
/* Section paragraph resets (both designs) zeroed the gap between the design cards and the status */
body.yf-dashboard-auth .yf-personalization .yf-personalization__status:not(:empty) { margin-top: 16px !important; }
/* «Эфир» sliding indicators (interactions.js) stay in the DOM after a live switch to «Малахит»: unstyled,
   they became flex/grid items that pushed nav items and broke the table/calendar switch and settings nav. */
body:not(.yf-redesign) .rd-seg-indicator { display: none !important; }
/* Profile: «Отображаемое имя» · wide field · «Сохранить имя» on one line, photo actions below (both designs) */
body.yf-dashboard-auth .yf-account-profile-layout { grid-template-columns: minmax(0, 1fr) !important; align-items: stretch; gap: 12px; }
body.yf-dashboard-auth .yf-account-profile-layout .yf-account-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto !important; align-items: center; gap: 12px; }
body.yf-dashboard-auth .yf-account-profile-layout .yf-account-inline-label { margin: 0; font-weight: 600; white-space: nowrap; }
body.yf-dashboard-auth .yf-account-profile-layout .yf-account-form input[name="name"] { width: 100%; min-width: 0; margin: 0; }
body.yf-dashboard-auth .yf-account-avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 575.98px) {
    body.yf-dashboard-auth .yf-account-profile-layout .yf-account-form { grid-template-columns: minmax(0, 1fr) auto !important; }
    body.yf-dashboard-auth .yf-account-profile-layout .yf-account-inline-label { grid-column: 1 / -1; }
    body.yf-dashboard-auth .yf-account-avatar-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Design switch in progress: the preview keeps its look, the check badge turns into a spinner (both designs) */
.yf-design-option.is-switching { pointer-events: none; }
.yf-design-option.is-switching .yf-design-preview { opacity: .82; transition: opacity .2s ease; }
.yf-design-option.is-switching .yf-design-option__check { opacity: 1; transform: none; }
.yf-design-option.is-switching .yf-design-option__check i { visibility: hidden; }
.yf-design-option.is-switching .yf-design-option__check::after {
    content: ""; position: absolute; inset: 4px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
    border-radius: 50%; animation: yf-design-switching .7s linear infinite;
}
@keyframes yf-design-switching { to { transform: rotate(360deg); } }

/* Primary-card colour switch: four swatches show what the cards look like (same gradients as hero-cards.css). */
.yf-account-switch--accents { justify-content: flex-start; }
.yf-account-switch--accents > span:nth-of-type(2) { flex: 1 1 auto; min-width: 0; }
.yf-accent-swatches { display: flex !important; flex: none; gap: 4px; }
.yf-accent-swatches i { display: block; width: 26px; height: 34px; border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 8px -4px rgba(0, 0, 0, .4); }
.yf-accent-swatches i:nth-child(1) { background: linear-gradient(155deg, #0f6b50, #052a20); }
.yf-accent-swatches i:nth-child(2) { background: linear-gradient(155deg, #1f6fe5, #0b2560); }
.yf-accent-swatches i:nth-child(3) { background: linear-gradient(155deg, #8c2c48, #3b0f20); }
.yf-accent-swatches i:nth-child(4) { background: linear-gradient(155deg, #3d4a66, #111827); }
.yf-account-switch--accents:has(input:not(:checked)) .yf-accent-swatches i { filter: grayscale(1) opacity(.55); box-shadow: none; }
@media (max-width: 575.98px) { .yf-accent-swatches i { width: 18px; } }
