/* FlixNest connection screen: the account is primary; device setup stays nearby. */
:root { --fn-bg: #101113; --fn-accent: #efbd78; }
body { background: var(--fn-bg); }
.player-header { background: #101113; box-shadow: none; min-height: 80px; padding: 16px 4vw; }
.brand { font-size: 28px; }
.brand-mark { width: 40px; height: 40px; background: #efbd78; box-shadow: none; border-radius: 8px; }
.devices-button { min-height: 44px; margin-left: 12px; padding: 10px 16px; font-size: 16px; color: #f3f1ed; }
.install-app-button { min-height: 44px; padding: 10px 24px; font-size: 16px; border-radius: 6px; background: transparent; border: 1px solid #efbd78; box-shadow: none; }
.setup-view { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "copy copy" "form other" "devices devices"; gap: 24px 38px; align-items: start; min-height: 0; max-width: 1260px; padding: 10px 0 32px; }
.setup-copy { grid-area: copy; max-width: none; text-align: center; padding: 0 0 8px; margin: 0; }
.setup-copy h1 { margin: 0 0 8px; font-size: clamp(28px, 3.5vw, 46px); line-height: 1.2; letter-spacing: -1px; background: none; color: #f3f1ed; }
.setup-copy p { max-width: none; color: #bbc0c6; font-size: 20px; line-height: 1.5; }
.setup-access { grid-area: form; min-width: 0; }
.access-form { padding: 24px; border: 1px solid #34373c; border-radius: 8px; background: #18191c; box-shadow: none; backdrop-filter: none; overflow: visible; }
.access-methods { grid-template-columns: 1.4fr 1fr 1fr; margin: -6px 0 22px; }
.access-methods button { min-height: 48px; padding: 8px 6px; color: #bbc0c6; font-size: 16px; line-height: 1.3; }
.access-methods button[aria-selected="true"] { color: #efbd78; }
.access-methods button[aria-selected="true"]::after { left: 0; right: 0; background: #efbd78; }
.access-form .field { gap: 7px; }
.access-form .form-fields { gap: 16px; }
.access-form .field > span, .access-form .field > label { color: #f3f1ed; font-size: 16px; font-weight: 500; }
.access-form input:not([type="checkbox"]) { min-height: 56px; border: 1px solid #50545c; border-radius: 6px; background: #1d1f23; color: #f3f1ed; padding: 11px 14px; font-size: 16px; }
.access-form input::placeholder { color: #a7afb9; }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 78px !important; }
.password-field button { position: absolute; right: 4px; top: 6px; min-height: 44px; min-width: 64px; border: 1px solid #34373c; border-radius: 6px; background: transparent; color: #ccd1d6; font-size: 14px; }
.password-field button:hover { background: #303238; }
.access-form .check-field { min-height: 44px; gap: 10px; margin: 12px 0; align-items: center; cursor: pointer; }
.access-form .check-field input { width: 20px; height: 20px; accent-color: #efbd78; }
.access-form .check-field span { font-size: 16px; color: #f3f1ed; }
.access-form .primary-button { min-height: 52px; border-radius: 6px; background: #efbd78; box-shadow: none; color: #19130b; font-size: 18px; font-weight: 700; }
.access-form .primary-button:hover:not(:disabled) { background: #f6cd91; }
.access-form .primary-button:disabled { opacity: .65; cursor: wait; }
.access-form .privacy-note, .field-hint { margin: 12px 0 0; color: #bbc0c6; font-size: 14px; line-height: 1.5; }
.access-form .form-error { line-height: 1.5; }
.access-help { margin: 16px 0 0; font-size: 16px; }
.setup-view a { color: #efbd78; text-underline-offset: 3px; }
.connect-other { display: block; grid-area: other; min-width: 0; align-self: stretch; padding: 8px 0 0 32px; border-left: 1px solid #34373c; margin: 0; border-top: 0; }
.connect-other h2, .device-guide h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.3; letter-spacing: -.5px; font-weight: 700; }
.connect-other > p { margin: 0 0 20px; font-size: 18px; color: #bbc0c6; line-height: 1.5; }
.connect-device { display: flex; align-items: center; width: 100%; min-height: 104px; gap: 20px; padding: 16px 8px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #f3f1ed; }
.connect-device:hover { background: #1d1f23; border-color: #34373c; }
.connect-device svg { width: 36px; height: 36px; flex: 0 0 36px; }
.connect-device strong { display: block; font-size: 20px; font-weight: 600; }
.connect-device small { display: block; margin-top: 6px; font-size: 16px; line-height: 1.5; color: #bbc0c6; }
.device-guide { grid-area: devices; margin-top: 16px; padding-top: 28px; border-top: 1px solid #34373c; scroll-margin-top: 90px; }
.device-guide h2 { margin-bottom: 24px; }
.device-guide-columns { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 24px; }
.device-guide-columns > section { display: flex; align-items: start; gap: 20px; min-width: 0; }
.device-guide-columns > section > div { min-width: 0; }
.device-icon { flex: 0 0 40px; width: 40px; height: 40px; margin-top: 2px; }
.device-guide-columns > section + section { border-left: 1px solid #34373c; padding-left: 24px; }
.device-guide h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.4; }
.device-guide p { margin: 0 0 8px; color: #bbc0c6; font-size: 16px; line-height: 1.5; }
.device-guide a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; }
.device-guide .device-detail { font-size: 13px; }
.device-guide .device-detail strong { font-weight: 500; }
.device-guide .device-address { color: #efbd78; overflow-wrap: anywhere; }
.device-guide .secondary-button { min-height: 44px; border: 1px solid #efbd78; background: transparent; border-radius: 6px; font-size: 16px; color: #efbd78; }
.setup-view .pair-panel { grid-area: form; border-radius: 8px; background: #18191c; box-shadow: none; }
html:not(.tv-mode) .setup-view.is-pairing .setup-access { display: none; }
.setup-view .pair-kicker { display: none; }
.setup-view :focus-visible, .devices-button:focus-visible { outline: 2px solid #efbd78; outline-offset: 4px; }
.setup-view [hidden] { display: none !important; }
.dialog { max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 10px; box-shadow: none; }
.dialog .device-guide { margin-top: 12px; }
.dialog .device-guide-columns { grid-template-columns: 1fr; }
.dialog .device-guide-columns > section + section { border-left: 0; border-top: 1px solid #34373c; padding: 18px 0 0; }
.dialog a { color: #efbd78; }
#account-settings { border-radius: 8px; background: #18191c; }
html.tv-mode .setup-view { grid-template-areas: "copy copy" "pair form"; }
html.tv-mode .player-header { min-height: calc(60px * var(--tv-scale)); padding: calc(10px * var(--tv-scale)) var(--tv-gutter); }
html.tv-mode .setup-access { grid-area: form; }
html.tv-mode .connect-other, html.tv-mode .setup-view > .device-guide { display: none; }
html.tv-mode .setup-copy { display: block; text-align: left; }
html.tv-mode .setup-copy p { font-size: calc(15px * var(--tv-scale)); }
html.tv-mode .access-form { height: auto; }
html.tv-mode .access-form input:not([type="checkbox"]) { min-height: calc(44px * var(--tv-scale)); }
html.tv-mode .access-form .field > span, html.tv-mode .access-form .field > label { font-size: calc(15px * var(--tv-scale)); }
html.tv-mode .access-form .primary-button { min-height: calc(46px * var(--tv-scale)); font-size: calc(17px * var(--tv-scale)); }
html.tv-mode .access-form .privacy-note { font-size: calc(12px * var(--tv-scale)); }
html.tv-mode .password-field button { top: 0; min-height: calc(44px * var(--tv-scale)); }
html.tv-mode .devices-button { display: none; }
@media (max-width: 760px) {
    .player-header { min-height: 64px; padding: 12px 18px; }
    .brand { font-size: 20px; }
    .brand-mark { width: 32px; height: 32px; }
    .setup-view { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "form" "other" "devices"; gap: 24px; padding-top: 10px; }
    .setup-copy { text-align: left; }
    .setup-copy h1 { font-size: 30px; }
    .setup-copy p { font-size: 15px; max-width: 38ch; }
    .connect-other { border-left: 0; border-top: 1px solid #34373c; padding: 24px 0 0; }
    .connect-other h2, .device-guide h2 { font-size: 22px; }
    .connect-other > p { margin-bottom: 8px; }
    .connect-other > p { font-size: 15px; }
    .connect-device strong { font-size: 17px; }
    .connect-device small { font-size: 14px; }
    .connect-device { min-height: 88px; padding: 12px 4px; gap: 16px; }
    .device-guide-columns { grid-template-columns: 1fr; gap: 20px; }
    .device-guide-columns > section + section { border-left: 0; border-top: 1px solid #34373c; padding: 20px 0 0; }
    .device-guide h2 { margin-bottom: 18px; }
    .setup-view .pair-panel { grid-template-columns: 1fr; }
    .access-form { padding: 18px; }
    .access-form input:not([type="checkbox"]) { min-height: 48px; }
    .password-field button { top: 2px; }
    .access-form .check-field span { font-size: 14px; }
    .access-methods { margin: -4px 0 20px; }
    .access-methods button { font-size: 13px; }
    .devices-button { margin-left: 4px; padding: 8px; font-size: 13px; }
    .install-app-button { font-size: 13px; padding: 8px 10px; }
    html:not(.tv-mode) .setup-view.is-pairing { grid-template-areas: "copy" "form" "other" "devices"; }
}
@media (max-width: 380px) {
    .player-header { gap: 8px; padding-left: 14px; padding-right: 14px; }
    .brand { gap: 8px; font-size: 18px; }
    .brand-mark { width: 28px; height: 28px; }
    .access-methods button { font-size: 12px; }
}
@media (max-height: 600px) and (min-width: 761px) {
    html.tv-mode .player-header { min-height: 52px; height: 52px; padding-top: 6px; padding-bottom: 6px; }
    html.tv-mode .player-main { padding-top: 10px; padding-bottom: 10px; min-height: calc(100vh - 52px); }
    html.tv-mode .setup-view { gap: 12px 24px; min-height: calc(100vh - 72px); }
    html.tv-mode .setup-copy { padding: 0; }
    html.tv-mode .setup-copy h1 { font-size: 24px; margin-bottom: 4px; }
    html.tv-mode .setup-copy p { font-size: 13px; }
    html.tv-mode .access-form { padding: 14px; }
    html.tv-mode .access-methods { margin: -14px -14px 12px; }
    html.tv-mode .access-methods button { min-height: 44px; font-size: 12px; }
    html.tv-mode .access-form .form-fields { gap: 10px; }
    html.tv-mode .access-form .field { gap: 4px; }
    html.tv-mode .access-form .field > span, html.tv-mode .access-form .field > label { font-size: 13px; }
    html.tv-mode .access-form input:not([type="checkbox"]) { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
    html.tv-mode .access-form .check-field { min-height: 32px; margin: 8px 0; }
    html.tv-mode .access-form .check-field span { font-size: 13px; }
    html.tv-mode .access-form .primary-button { min-height: 44px; font-size: 16px; }
    html.tv-mode .access-form .privacy-note { margin-top: 8px; font-size: 12px; }
    html.tv-mode .password-field button { min-height: 40px; font-size: 13px; }
    html.tv-mode .access-help { display: none; }
    html.tv-mode .pair-panel { padding: 16px; gap: 16px; }
    html.tv-mode .pair-qr { width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
    .setup-view *, .dialog * { scroll-behavior: auto; transition: none; animation: none; }
}
